Skip to content
Agent UI
PrimitivesScrollArea

ScrollArea

Keyboard-focusable overflow container using native scrollbars. Import from @agent-ui/react or a direct subpath. Tailwind CSS v4 theme tokens are required.

ScrollArea ships with a full API table, a copyable example, and accessibility notes.

tsx

Step 1: Example log entry

Step 2: Example log entry

Step 3: Example log entry

Step 4: Example log entry

Step 5: Example log entry

Step 6: Example log entry

Step 7: Example log entry

Step 8: Example log entry

Step 9: Example log entry

Step 10: Example log entry

Step 11: Example log entry

Step 12: Example log entry

Installation

Install the package once, then import ScrollArea from its direct entry point or from the root.

bash
pnpm add @agent-ui/react
tsx
import { ScrollArea } from "@agent-ui/react/scroll-area";

Tailwind CSS v4 users: add @source "../node_modules/@agent-ui/react/src" to the global stylesheet so the library utilities are generated.

Usage

The example below is the same code that renders the preview. Copy it, swap in your own handlers, and ship.

tsx
import { ScrollArea } from "@agent-ui/react";
 
<ScrollArea className="max-h-40">Long content</ScrollArea>

API reference

Every prop ScrollArea accepts, its type, default, and behaviour.

API reference for this component
NameTypeDefaultDescription
tabIndexReact prop—Configuration exposed through the component's public React props.
classNameReact prop—Configuration exposed through the component's public React props.

Accessibility

Uses native HTML semantics, keyboard controls and visible focus styles where applicable.
Use it with the rest of the library

ScrollArea composes with MessageList, ChatShell, useChat, and the provider compose blocks. Browse the full reference or see all components in the gallery.

3 lines · copy-ready