Message scroller: Jumping to messages
useMessageScroller drives the thread from outside it, and useMessageScrollerVisibility reports the current turn, so the outline highlights where you are.
This adds the example as components/examples/message-scroller/jump.tsx, together with the Message scroller component and the HextaUI theme tokens it needs.
pnpm dlx shadcn@latest add https://hextaui.com/r/message-scroller-jump.jsonTo add only the component, follow the Message scroller installation.
Props in this example
The Message scroller props this example sets, from the API reference.
| Prop | Type | Default |
|---|---|---|
defaultScrollPositionWhere the thread opens. | "start" | "end" | "last-anchor" | "end" |
| Prop | Type | Default |
|---|---|---|
aria-labelNames the conversation region. | string | – |
| Prop | Type | Default |
|---|---|---|
messageIdStable id for following, anchors and counts. | string | – |
scrollAnchorScroll this item to the top when it arrives, with defaultScrollPosition="last-anchor". | boolean | false |
Every prop is in the Message scroller API reference.
See them all, with keyboard support and accessibility notes, on the Message scroller page.
- ButtonButtons in every variant and size, with a built-in loading, success and error flow that skips the spinner for fast requests.
- MotionThe easing curves, durations and reduced-motion check every component animates with, plus hooks for size morphs and sliding highlights.
- MessageA chat message row with an avatar, name, bubbles and status, where new messages rise in from the sender's side.
- AttachmentFile and image cards for uploads, with progress, states, actions, a full-card trigger and names that keep their extension.
- BubbleChat message bubbles with variants, grouped corners, reactions and room for interactive content.
- MarkerQuiet notes between content, like date dividers and system events, with sticky dates and times that read as Today or Yesterday.