Message scroller
v0.64.0, changelogBetaA conversation's scrolling log that follows the newest turn at the bottom, offers Jump to latest, holds still when older turns load, and reads each complete turn once.
Conversation
Install
npx shadcn add @syncrobotic/message-scroller Also installs: lucide-react@^1, @syncrobotic/cn, @syncrobotic/button, @syncrobotic/format-number, @syncrobotic/use-presence, @syncrobotic/use-reduced-motion
Overview
When to use
- The middle of an assistant panel, between its header and the prompt composer.
- A side copilot in a Sheet, in a flex column that ends with the composer.
- Any conversation that grows at the bottom while someone reads further up.
Use something else
- Lines a program writes as it runs: Log viewer.
- A fixed list people scroll without anything arriving: Scroll area.
- Events in time order with no conversation: Timeline.
More examples
States and real uses. Each example is also a Storybook story and a visual regression test.
Streaming
Load earlier
Empty
Traditional Chinese (zh-TW)
Usage rules
- The scrolling box of a conversation: Message turns as its direct children, oldest first. Give it a height (
className: h-96, or min-h-0 flex-1 in a column). - It follows the newest turn while the reader is at the bottom, also while an answer streams, and lets go the moment they scroll up. Do not scroll it yourself as tokens arrive.
- Jump to latest shows whenever the reader is away from the bottom, with how many turns came since ("3 new"); it glides back, or jumps under reduced motion, and leaves focus on the conversation.
- Sending a turn of one's own (a Message with
role="user"appended) always goes back to the bottom. - Older turns:
hasEarlierandonLoadEarliershow Load earlier at the top; put the older turns in front ofchildrenand the view stays where it was. - Leave the reading to it: the log's own live region is off, StreamingText reads answers in sentences, and the scroller reads a turn once only when it arrives complete. Never add aria-live to the turns.
- Pass
emptyfor a new conversation: an EmptyState, with suggested prompts as chips.
Changelog
- 0.64.02026-12-01Formatted with Prettier (class order sorted); the code is unchanged.
- 0.53.02026-11-27Its doc opens with its description, word for word; the code is unchanged.
- 0.51.02026-11-27Comments trimmed to what they need to say; the code is unchanged.