# Shadcn Jump to Latest

> Chat transcript with jump to latest

- Type: example, free and open source (MIT)
- Component: [Message Scroller](https://web.dev.reui.io/components/message-scroller.md)
- Page: https://web.dev.reui.io/components/message-scroller/c-message-scroller-1
- Docs (Base UI): https://ui.shadcn.com/docs/components/base/message-scroller.md
- Docs (Radix UI): https://ui.shadcn.com/docs/components/radix/message-scroller.md
- MCP: `get_example("c-message-scroller-1")`
- Registry item: https://web.dev.reui.io/r/styles/base-nova/c-message-scroller-1.json
- Uses: Avatar, Bubble, Card, Message, Message Scroller

## Best for

A read only 9 message thread on the provider defaults, with no client state, streaming or composer to strip out

## Agent notes

- Replace `TURNS` with your thread and `VIEWER_AVATAR`, an Unsplash photo, with the signed in user's picture
- Change the `aria-label` on `MessageScrollerViewport` for each surface; without one the region is announced as Messages

## Install

```bash
npx shadcn@latest add @reui/c-message-scroller-1
```

## About Shadcn Message Scroller

### When to use

- Chat and assistant transcripts in a bounded panel that open on the newest turn and offer a jump back to it
- Streaming replies that follow the bottom until the reader scrolls up, with sent questions lifted near the top
- Saved threads that reopen at a chosen turn, load older history above the reader or step between questions

### When not to use

- The layout of a single turn, its avatar, sender name and timestamp around the body: use [Message](https://web.dev.reui.io/components/message.md) (`get_component("message")`)
- A sidebar, settings list or panel that overflows but never grows at the bottom: use [Scroll Area](https://web.dev.reui.io/components/scroll-area.md) (`get_component("scroll-area")`)
- A finished assistant screen with composer, thread list, citations and docked panels: use the [AI Chat blocks](https://web.dev.reui.io/blocks/ai-agents/ai-chat.md)

### Agent notes

- The parts and hooks throw outside `MessageScrollerProvider`, so a header or footer control that calls a hook needs the provider above it too
- `MessageScroller` fills its parent through `size-full`, so bound the parent height or the page scrolls instead of the transcript
- Render `MessageScrollerButton` as a sibling of `MessageScrollerViewport`; placed inside it, the control scrolls away with the rows

Every ReUI item has a twin like this one; the index is https://web.dev.reui.io/llms.txt. Agents with the ReUI MCP (https://web.dev.reui.io/docs/mcp) get the same guidance from the getters named above.
