---
agent:
  instructions: "Search goop.so for Goop's components, templates, design skill, docs, pricing and terms. Ask in keywords or a plain question, such as \"date picker props\" or \"is the design skill free\"; the answer is the matching page sections in Markdown, each with its address."
  endpoint: "https://goop.so/.well-known/search?q={query}"
  method: "GET"
  documentation: "https://developers.cloudflare.com/ai-search/how-to/search-for-agents/"
---

# Message list

The messages of one conversation in a column, the newest at one end, as they arrive, for React and Tailwind CSS. Part of Goop Pro.

Pro. Its export: `MessageList`.

## Try it

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.

```sh
npx shadcn@4.23.1 add https://registry.goop.so/g/<link>/trail-message-list.json --yes
```

```text
Add the Goop Message list to this project. The install steps are at https://goop.so/docs/install.md
```

## Usage

```tsx
import { MessageList } from '@/components/ui/goop/message-list';
import { ChatMessage } from '@/components/ui/goop/chat-message';
import { Avatar } from '@/components/ui/goop/avatar';
import { Composer, ComposerEditor, ComposerToolbar, ComposerActions, ComposerSubmit } from '@/components/ui/goop/composer';

<div className="flex h-96 flex-col gap-3 px-6">
  <MessageList aria-label="Conversation with Ngozi" inset={false} className="flex-1">
    <ChatMessage author="Ngozi Ilori" avatar={<Avatar variant="solid" name="Ngozi Ilori">NI</Avatar>} time="09:41">
      Looks good. One thing: the empty state still says sessions.
    </ChatMessage>
    <ChatMessage from="self" author="You" time="09:44">
      On it.
    </ChatMessage>
  </MessageList>
  <Composer variant="reply" aria-label="Reply" onSubmit={send}>
    <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, motion: add no class for these.

## API reference

### Options

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

- Another example of it: chat-message.md

## Accessibility

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

## Related

- [Chat message](/themes/trail/components/chat-message): One message of a conversation: its author, its body and when it was sent, often an avatar and actions.
- [Avatar](/themes/trail/components/avatar): A person's or a team's picture or initials, beside their name or on its own.
- [Composer](/themes/trail/components/composer): A box to write a message, a comment or a prompt in, with attachments and a send button, for a chat or a record's comments.
- [Attachment list](/themes/trail/components/attachment-list): The files chosen to send, under a composer or a form field.
