A thread
Two speakers. The footer of the first message rides above the avatar, so the avatar keeps standing beside the last bubble.
The row of a chat message: an avatar, a column with a header, the bubbles and a footer, aligned to the start or the end. Also MessageText, which sets a reply word by word so streaming text soaks in like wet ink.
npx shadcn@latest add @wobko/message第一次使用?先把 registry 加进 components.json。 如何安装
Two speakers. The footer of the first message rides above the avatar, so the avatar keeps standing beside the last bubble.
MessageText keeps the words already on the page and soaks each new word in as it arrives: dark and blurred at first, then dry. A felt-tip caret rides after the last word.
Header and footer are quiet hand notes. A reaction chip and a tick make a message look lived in.
`pen="you"` sets a bubble in blue felt and the script face. MessageText keeps its words plain inline text with a baseline offset and a lighter ink, so the tall last letters of a script face (d, l, e, !) are whole.
shadcn's `message-demo`: two speakers, avatars on the side of their message, a delivery note under the last of mine, a pair of muted bubbles with a reaction chip, and a typing marker to end. The photo avatars of the original are initials on marker here.
shadcn's `message-avatar`: MessageAvatar sits at the bottom of the row, on the side the message is aligned to (`align="end"` moves it to the right). In a BubbleGroup the avatar stays beside the last bubble.
shadcn's `message-group`: consecutive messages from one sender. The earlier ones carry an empty MessageAvatar to hold the column, so the words line up and the face appears once, on the last.
shadcn's `message-header-footer`: MessageHeader names the sender above the bubble, MessageFooter holds a receipt below it. The header stays at the start whatever the alignment; the footer follows the message.
shadcn's `message-actions`: icon buttons in MessageFooter (copy, like, dislike), each with an `aria-label`, and a failed send with a retry. The thumbs are not drawn yet, so like and dislike wear a tick and a cross-out.
shadcn's `message-attachment`: an image attachment above the bubble that sent it (a polaroid under tape), and a PDF the reply hands back (a slip with a paper clip and a download button). The photograph is a sticker so the page needs no network.
shadcn's `message-markdown`: the user's message stays plain text in a bubble; the assistant's reply goes in a `ghost` bubble, which has no frame, so rendered markdown (a list, bold, inline code) reads as a page. shadcn's docs render it with their own Markdown component, which is not part of the registry; the markup below is what such a renderer produces.
One message row. `align="end"` reverses it and tells the bubbles inside to put their tail on that side.
| 属性 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| align | "start" | "end" | "start" | Which end of the row the message sits on. |
The words of a message as real text, set like a person wrote them: each word sits a hair off the baseline, some a shade lighter. While `streaming`, every word that arrives after the first render soaks in (dark and blurred, then dry in half a second) and a felt-tip caret rides after the last word.
| 属性 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| children | string | - | The text so far. Newlines are kept. |
| streaming | boolean | false | Soak new words in and show the caret. |
| jitter | boolean | true | The per-word wobble (zero in calm density and with reduced motion). |
| seed | string | number | - | Pins the wobble. |
CLI 会复制进你项目的文件。
正在加载源码