npx shadcn@4.23.1 add https://registry.goop.so/g/<link>/meadow-message-list.json --yesMessage list
ProThe messages of one conversation in a column, the newest at one end, as they arrive, for React and Tailwind CSS. Part of Goop Pro.
What an agent sees
import {
Composer,
ComposerActions,
ComposerEditor,
ComposerSubmit,
ComposerToolbar,
} from '@/components/ui/goop/composer';
import { MessageList } from '@/components/ui/goop/message-list';
const MESSAGES = [
{ id: '1', author: 'Ngozi Ilori', text: 'Looks good. One thing: the empty state still says sessions.' },
{ id: '2', author: 'You', text: 'On it.' },
];
function Thread({ messages = MESSAGES }: { messages?: { id: string; author: string; text: string }[] }) {
return (
<div className="flex h-96 flex-col gap-3 px-6">
<MessageList aria-label="Conversation with Ngozi" inset={false} className="flex-1">
{messages.map((message) => (
<article key={message.id} className="pt-4 text-base text-foreground">
<p className="font-semibold">{message.author}</p>
<p>{message.text}</p>
</article>
))}
</MessageList>
<Composer variant="reply" aria-label="Reply" onSubmit={(event) => event.preventDefault()}>
<ComposerEditor aria-label="Message" placeholder="Write a message..." />
<ComposerToolbar>
<ComposerActions>
<ComposerSubmit aria-label="Send message" />
</ComposerActions>
</ComposerToolbar>
</Composer>
</div>
);
}Watch new messages arrive every few seconds: at the bottom the list follows them; scroll up and it stays put and offers “Jump to latest”. Reply from the box under it (Ctrl/Cmd+Enter sends). The customer is a timer with five messages of our own; replies go nowhere.
When to use
- The messages of one conversation in a column, the newest at one end, as they arrive.
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 Message list 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>/meadow-message-list.json --yesAdd the Goop Message list to this project. The install steps are at https://goop.so/docs/install.mdUsage
import {
Composer,
ComposerActions,
ComposerEditor,
ComposerSubmit,
ComposerToolbar,
} from '@/components/ui/goop/composer';
import { MessageList } from '@/components/ui/goop/message-list';
const MESSAGES = [
{ id: '1', author: 'Ngozi Ilori', text: 'Looks good. One thing: the empty state still says sessions.' },
{ id: '2', author: 'You', text: 'On it.' },
];
function Thread({ messages = MESSAGES }: { messages?: { id: string; author: string; text: string }[] }) {
return (
<div className="flex h-96 flex-col gap-3 px-6">
<MessageList aria-label="Conversation with Ngozi" inset={false} className="flex-1">
{messages.map((message) => (
<article key={message.id} className="pt-4 text-base text-foreground">
<p className="font-semibold">{message.author}</p>
<p>{message.text}</p>
</article>
))}
</MessageList>
<Composer variant="reply" aria-label="Reply" onSubmit={(event) => event.preventDefault()}>
<ComposerEditor aria-label="Message" placeholder="Write a message..." />
<ComposerToolbar>
<ComposerActions>
<ComposerSubmit aria-label="Send message" />
</ComposerActions>
</ComposerToolbar>
</Composer>
</div>
);
}- Fits: chat, inbox (their recipes).
- height, width, padding, corner, motion: add no class for these.
API reference
| Option | Type | What it does |
|---|---|---|
| jumpLabel? | string = 'Jump to latest' | The words of the button that brings the newest message back into view. |
| inset? | boolean = true | 16 px between the messages and the thread's sides (true, the default), or none (false), the messages lined up with the edges of the column the thread stands in and the heading or reply box above or under it. |
- data-slot values (to select a part by): message-list, message-list-action, message-list-viewport
Keyboard
| Key | What it does |
|---|---|
| Tab | On the thread: its own tab stop, then Jump to latest while it shows |
| ArrowUp ArrowDown PageUp PageDown Home End | On the thread: scroll it (the browser's own scrolling) |
| Enter Space | On Jump to latest: bring the newest message into view, the focus back on the thread |
Accessibility
- The part itself answers the keys above.
- focus-visible: the browser's own (:focus-visible): write nothing
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.