Shows a transcript that stays at the newest message while it streams.
Which segment grew the fastest?
The CLI adds the files, packages, theme variables, and Tailwind plugin that this component uses. Before you run it, set up your project.
ConversationOwns the pin state. Call scrollToLatest from useConversation when the user sends.
ConversationContentThe scroller. Give each message data-conversation-item; Message does it for you.
ConversationLoadOlderOptionalConversationEmptyOptional
ConversationJumpOptional
useConversation Returns isPinned, newCount, and scrollToLatest for the send button.
Scroll up while the answer streams to show the button. Also install Message and Response.
Also install Message and Response.
Also install Empty state, Prompt input, Message and Response.
Ask about this week
Fernway reads the last 30 days of product data and links each number to its source.
Call scrollToLatest when the user sends a message. Also install Message, Response and Prompt input.
Conversation
- aria-label: string = "Conversation"
- Names the log region for screen readers.
- initialScroll: "bottom" | "top" = "bottom"
- Sets the first scroll position, with no animation.
- threshold: number = 24
- Sets how close to the bottom the reader must scroll to pin the view again.
ConversationContent
- className: string
- Sets the width, padding, and gap of the message list inside the scroller.
ConversationEmpty
- children: ReactNode
- The empty content, usually an EmptyState. It shows until the first message renders.
ConversationLoadOlder
- onLoad: () => void | Promise<void>Required
- Loads the older messages. Runs when the sentinel enters view and when the button is pressed. A pending promise shows a spinner.
- hasMore: booleanRequired
- Renders the sentinel. Set it to false after the last page loads.
- children: ReactNode
- Replaces the button label.
ConversationJump
- children: ReactNode = "Jump to latest"
- Replaces the visible label. The new message count stays in the accessible name.