npx shadcn@4.23.1 add https://registry.goop.so/g/<link>/trail-chat-message.json --yesChat message
ProOne message of a conversation: its author, its body and when it was sent, often an avatar and actions, for React and Tailwind CSS. Part of Goop Pro.
What an agent sees
- ChatMessageCopyThe action that copies a message's words, for its
actionsrow - ChatMessageThinkingThe status line a reply shows before its words
import { ChatMessage, ChatMessageCopy, ChatMessageThinking } from '@/components/ui/goop/chat-message';
import { MessageList } from '@/components/ui/goop/message-list';
import { Avatar } from '@/components/ui/goop/avatar';
import { IconButton, IconButtonIcon } from '@/components/ui/goop/icon-button';
<MessageList aria-label="Conversation with Ngozi" className="h-96">
<ChatMessage author="Ngozi Ilori" avatar={<Avatar variant="solid" name="Ngozi Ilori">NI</Avatar>} time="09:41" dateTime="2026-11-19T09:41">
Looks good. One thing: the empty state still says sessions.
</ChatMessage>
<ChatMessage
author="Ngozi Ilori"
time="09:42"
continued
actions={
<>
<ChatMessageCopy />
<IconButton variant="ghost" size="sm" aria-label="Add a reaction">
<IconButtonIcon icon="mood-plus" />
</IconButton>
</>
}
>
Can we keep the old label for a week?
</ChatMessage>
<ChatMessage from="self" author="You" time="09:44" status="failed" onRetry={send}>
On it.
</ChatMessage>
<ChatMessage author="Assistant" avatar={<Avatar variant="solid" name="Assistant">AI</Avatar>} time="09:46" streaming>
Last week's 11 interviews mostly mention the consent
</ChatMessage>
<ChatMessage author="Assistant" avatar={<Avatar variant="solid" name="Assistant">AI</Avatar>} time="09:47">
<ChatMessageThinking>Thinking…</ChatMessageThinking>
</ChatMessage>
<ChatMessage
author="Assistant"
avatar={<Avatar variant="solid" name="Assistant">AI</Avatar>}
time="09:47"
sources={[
{ title: 'Interview notes, week 46', kind: 'document', href: '/notes/week-46' },
{ title: 'Consent form wording', kind: 'pdf', href: '/files/consent-form.pdf' },
]}
actions={<ChatMessageCopy />}
>
Seven of the eleven interviews mention the consent step.
</ChatMessage>
<ChatMessage from="self" author="You" time="09:48" variant="note">
Ngozi asked for the new label by Friday.
</ChatMessage>
</MessageList>Ask one of the three questions: your message shows “Sending…”, the first one fails and offers Retry, then the reply thinks for a moment and streams in. Copy a finished reply with its Copy button. The assistant is a timer with three answers of our own; the first send fails on purpose.
When to use
- One message of a conversation: its author, its body and when it was sent, often an avatar and actions.
- Also called: message bubble.
Installation
Paste the prompt below into your coding agent. It reads Goop's install steps, installs the part and its tokens once, then reuses this same Chat message on every screen instead of drawing a new one: the same height, the same focus ring, the same spacing. As a Pro part, its command comes from Goop's server once you sign in, with a one-time link that lasts ten minutes.
npx shadcn@4.23.1 add https://registry.goop.so/g/<link>/trail-chat-message.json --yesAdd the Goop Chat message to this project. The install steps are at https://goop.so/docs/install.mdUsage
import { ChatMessage, ChatMessageCopy, ChatMessageThinking } from '@/components/ui/goop/chat-message';
import { MessageList } from '@/components/ui/goop/message-list';
import { Avatar } from '@/components/ui/goop/avatar';
import { IconButton, IconButtonIcon } from '@/components/ui/goop/icon-button';
<MessageList aria-label="Conversation with Ngozi" className="h-96">
<ChatMessage author="Ngozi Ilori" avatar={<Avatar variant="solid" name="Ngozi Ilori">NI</Avatar>} time="09:41" dateTime="2026-11-19T09:41">
Looks good. One thing: the empty state still says sessions.
</ChatMessage>
<ChatMessage
author="Ngozi Ilori"
time="09:42"
continued
actions={
<>
<ChatMessageCopy />
<IconButton variant="ghost" size="sm" aria-label="Add a reaction">
<IconButtonIcon icon="mood-plus" />
</IconButton>
</>
}
>
Can we keep the old label for a week?
</ChatMessage>
<ChatMessage from="self" author="You" time="09:44" status="failed" onRetry={send}>
On it.
</ChatMessage>
<ChatMessage author="Assistant" avatar={<Avatar variant="solid" name="Assistant">AI</Avatar>} time="09:46" streaming>
Last week's 11 interviews mostly mention the consent
</ChatMessage>
<ChatMessage author="Assistant" avatar={<Avatar variant="solid" name="Assistant">AI</Avatar>} time="09:47">
<ChatMessageThinking>Thinking…</ChatMessageThinking>
</ChatMessage>
<ChatMessage
author="Assistant"
avatar={<Avatar variant="solid" name="Assistant">AI</Avatar>}
time="09:47"
sources={[
{ title: 'Interview notes, week 46', kind: 'document', href: '/notes/week-46' },
{ title: 'Consent form wording', kind: 'pdf', href: '/files/consent-form.pdf' },
]}
actions={<ChatMessageCopy />}
>
Seven of the eleven interviews mention the consent step.
</ChatMessage>
<ChatMessage from="self" author="You" time="09:48" variant="note">
Ngozi asked for the new label by Friday.
</ChatMessage>
</MessageList>- Fits: chat, inbox, states (their recipes).
- width, padding, gap, corner, background, text, motion: add no class for these.
API reference
- Each option with its sentence: chat-message--options.md
| Part | What it is |
|---|---|
| ChatMessageCopy | The action that copies a message's words, for its actions row; its props: chat-message--copy.md |
| ChatMessageThinking | The status line a reply shows before its words; its props: chat-message--thinking.md |
- data-slot values (to select a part by): chat-message, chat-message-actions, chat-message-body, chat-message-caption, chat-message-content, chat-message-copy, chat-message-header, chat-message-media, chat-message-note, chat-message-note-icon, chat-message-note-label, chat-message-source, chat-message-sources, chat-message-status, chat-message-status-icon, chat-message-status-text, chat-message-thinking, chat-message-thinking-line, chat-message-thinking-text, chat-message-title, chat-message-word
ChatMessageCopy
The action that copies a message's words, for its actions row.
import { ChatMessageCopy } from '@/components/ui/goop/chat-message';Options
- label?: string = 'Copy' — The button's words at rest.
- copiedLabel?: string = 'Copied' — Its words once the message's words are on the clipboard.
- failedLabel?: string = 'Couldn’t copy' — Its words when the clipboard refused them or there is none.
- Also takes: onClick?: (event: MouseEvent) => void; disabled?: boolean; loading?: boolean = false; loadingLabel?: string = 'Loading'
ChatMessage: every option
import { ChatMessage } from '@/components/ui/goop/chat-message';Options
- from?: 'self' | 'other' = 'other' — Who wrote it: the reader (
self, at the end in a fill) or another person (other). - author: ReactNode — The author's name ("You" for the reader's own); with the time, the message's name.
- avatar?: ReactNode — Another person's
Avatar variant="solid";from="self"draws none. - time: ReactNode — The time as the heading shows it ("09:41", "Yesterday").
- dateTime?: string — The time for a machine (ISO), on the heading's
timeelement. - continued?: boolean = false — The message follows another of the same author: its avatar and heading hidden, still read.
- status?: 'sent' | 'sending' | 'failed' = 'sent' — Posted (
sent), on its way (sending) or refused (failed, with the red mark and the retry). - statusLabel?: string — The status line's words in place of "Sending" or "Not sent".
- onRetry?: () => void — Called by the failed message's retry button; with none, no retry is offered.
- retryLabel?: string = 'Retry' — The retry button's words.
- actions?: ReactNode — The caller's buttons for this message (copy, more), in one row under the words.
- sources?: readonly ChatMessageSource[] — What the message cites, in a list under the words and above the actions: each a link (
href) or a button (onSelect) with its kind's mark and its title; held back while the message streams. - sourcesLabel?: string = 'Sources' — The sources list's name for a screen reader.
- streaming?: boolean = false — The message is still arriving: each new word fades in; busy until it ends.
- variant?: 'default' | 'note' | 'question' = 'default' —
note: a note for the writer's team, in a faint warm box under its label. - noteLabel?: string = 'Internal note' — The note's label words ("Internal note").
- children: ReactNode — The words of the message.
ChatMessageThinking
The status line a reply shows before its words.
import { ChatMessageThinking } from '@/components/ui/goop/chat-message';Options
- children: string — The words of the status ("Thinking…"); a change crossfades to the new words.
Accessibility
- hover, focus-visible: the browser's own (:hover, :focus-visible): write nothing
Motion
- The part sets its own motion: add no transition or animation of your own.
- How the theme moves, and how to move your own parts the same way: Motion.
Notes for AI
Give your coding agent this page as text instead of screenshots: the parts, the options, the states and the keys. An agent that reads the real part builds the real part, not a lookalike.