Theme
Install with your agentnpx shadcn@4.23.1 add https://registry.goop.so/g/<link>/meadow-chat-message.json --yes

Chat message

Pro

One 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.

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.

Terminal
npx shadcn@4.23.1 add https://registry.goop.so/g/<link>/meadow-chat-message.json --yes
PROMPT
Add the Goop Chat message to this project. The install steps are at https://goop.so/docs/install.md

Usage

TSX
import { ChatMessage, ChatMessageCopy, ChatMessageThinking } from '@/components/ui/goop/chat-message';
import { IconButton, IconButtonIcon } from '@/components/ui/goop/icon-button';

function Answer({ thinking, onDelete }: { thinking: boolean; onDelete: () => void }) {
  return (
    <div className="flex flex-col">
      <ChatMessage from="self" variant="question" author="You" time="09:45">
        Which events moved this month?
      </ChatMessage>
      <ChatMessage
        author="Assistant"
        time="09:46"
        sources={[{ title: 'November events plan', kind: 'document', href: '/plans/november' }]}
        actions={
          <>
            <ChatMessageCopy />
            <IconButton aria-label="Delete" onClick={onDelete}>
              <IconButtonIcon icon="trash" />
            </IconButton>
          </>
        }
      >
        {thinking ? (
          <ChatMessageThinking>Thinking…</ChatMessageThinking>
        ) : (
          <>
            <p>Two events moved:</p>
            <ol>
              <li>
                <strong>Farmers' market</strong> to Saturday
              </li>
              <li>
                <strong>Volunteer rota</strong> to nine
              </li>
            </ol>
          </>
        )}
      </ChatMessage>
    </div>
  );
}
  • Fits: chat, inbox (their recipes).
  • height, width, padding, gap, corner, background, text, motion: add no class for these.

API reference

Options
OptionTypeWhat it does
from?'self' | 'other' = 'other'Who wrote it: the reader (self, a bubble at the end; with variant="question", the question in the heading type) or another person (other).
authorReactNodeThe author's name ("You" for the reader's own); with the time, the message's name.
avatar?ReactNodeAnother person's Avatar variant="solid", in a 24 px gutter; with none, no gutter.
timeReactNodeThe time as the heading shows it ("09:41", "Yesterday").
dateTime?stringThe time for a machine (ISO), on the heading's time element.
continued?boolean = falseThe 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?stringThe status line's words in place of "Sending" or "Not sent".
onRetry?() => voidCalled by the failed message's retry button; with none, no retry is offered.
retryLabel?string = 'Retry'The retry button's words.
actions?ReactNodeThe caller's buttons for this message (copy, delete), 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 = falseThe 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").
childrenReactNodeThe words of the message.
Parts
PartWhat it is
ChatMessageCopyThe action that copies a message's words, for its actions row; its props: chat-message--copy.md
ChatMessageThinkingThe line a reply shows before its words; children: string — The words of the status ("Thinking…"); a change crossfades to the new words

ChatMessageCopy

The action that copies a message's words, for its actions row.

TSX
import { ChatMessageCopy } from '@/components/ui/goop/chat-message';

Options

  • label?: string = 'Copy' — The button's name and tooltip.
  • copiedLabel?: string = 'Copied' — What its status says once the message's words are on the clipboard.
  • failedLabel?: string = 'Couldn’t copy' — What its status says when the clipboard refused them or there is none.
  • Also takes: onClick?: (event: MouseEvent) => void; disabled?: boolean; loading?: boolean = false; loadingLabel?: string = 'Loading'

Accessibility

  • hover: the browser's own (:hover): write nothing

Its states are drawn from attributes and props, so assistive technology and your agent read the same thing:

StateDrawn by
focus-visiblethe attribute data-focus-visible

Motion

  • The part sets its own motion: add no transition or animation of your own.

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.

goop.so/themes/meadow/components/chat-message.md · the page as Markdown
Theme
Install with your agentnpx shadcn@4.23.1 add https://registry.goop.so/g/<link>/meadow-chat-message.json --yes

Where would you like to start?

Free · now

The Goop plugin

A design system for your AI coding agent, so screen ten matches screen one.

/plugin marketplace add goop-so/skillsthen /plugin install goop@goopCodex, Cursor, ChatGPT, the Claude app and more: Connect Goop
FreePro

The components

Every part live, with its props, its keys and what an agent sees. Whole page and app templates, working with sample data.