---
title: "Message Scroller"
description: "Follows new output and lets go when you scroll up."
documentation: "https://beui.dev/react-native/message-scroller"
markdown: "https://beui.dev/react-native/message-scroller.md"
---

# Message Scroller

> Follows new output and lets go when you scroll up.

React Native component for Expo, from beUI Native. Group: AI agents. Variants: 1.

## Install

Set up beUI Native once per app first: https://beui.dev/docs/native-setup.md

```bash
npx beui-native add message-scroller
```

Or copy the source by hand and install its libraries:

```bash
npx expo install react-native-reanimated react-native-svg react-native-worklets
npm install uniwind tailwindcss
```

## Links

- Source: https://github.com/starc007/beui-native/tree/main/src/components/message-scroller
- Registry JSON with every file: https://beui.dev/native/r/message-scroller
- Open in Expo Go: exp://u.expo.dev/93a3a95c-6dc2-4adb-b57c-efbecf859f25/--/message-scroller?runtime-version=exposdk%3A58.0.0&channel-name=production
- Web version: https://beui.dev/components/agents/message-scroller.md

## README

### Message Scroller

Native port of [beUI Message Scroller](https://beui.dev/components/agents/message-scroller): a conversation that keeps the newest message in view.

```tsx
import { MessageScroller } from "./src";

<MessageScroller busy={streaming} contentClassName="p-4">
  {messages}
</MessageScroller>
```

#### Behavior

- While following, new content scrolls the conversation to the bottom.
- The moment you drag up past `followThreshold` (56 points), it stops following, so a streaming reply never pulls you away from what you're reading. Only your own scrolling changes this, never the component's.
- A "Jump to latest" pill springs up from the bottom while you're away from the end. Tapping it scrolls down and resumes following. Turn it off with `showJump={false}`.
- Once you've scrolled, messages fade out under the top edge instead of being cut off. The fade uses the background token; pass `fadeColor` when the scroller sits on another surface, or turn it off with `fadeTop={false}`.
- `onFollowChange` reports each change, and the ref's `scrollToEnd()` jumps to the latest message from your own controls.
- It's a `ScrollView`, so its props pass through. Inside another vertical scroll view on Android, set `nestedScrollEnabled`.

The web version's preview rail depends on hover, so it isn't ported. The jump pill takes its place on touch screens.

#### Better on a phone

- Pass `messageCount` and the pill counts what arrived while you were reading, such as "3 new messages", rolling as the count changes.
- It never scrolls against your finger: new output waits while you drag, and letting go near the end catches up.

#### Accessibility

- The scroll view is named "Conversation". Change it with `label`.
- The content is a polite live region on Android and is marked busy while `busy` is set.
- Reduced motion, or `disableAnimation`, jumps instead of scrolling smoothly and fades the pill in place.

Copy this directory, `primitives/fade-edge.tsx`, `hooks/use-presence.ts`, `hooks/use-reduced-motion.ts`, `primitives/agent-icons.tsx`, `primitives/roll-text.tsx`, `styles/motion.ts`, and the semantic tokens in `styles/theme.css`. It uses `react-native-svg` for its icon.
