Scroll Area
Explore interactive examples and all component variations in our Storybook.
ScrollArea wraps scrollable content in a custom viewport with consistently styled scrollbars across all browsers and operating systems. It replaces native overflow-auto wherever a uniform cross-platform appearance is needed.
Basic Usage
Set a fixed height on ScrollArea to create a vertically scrollable region. The styled scrollbar appears automatically.
Horizontal Scroll
Add <ScrollBar orientation="horizontal" /> and use whitespace-nowrap on the inner content to enable horizontal scrolling.
Fixed Height List
A contact list pattern with avatar placeholders, names, and email addresses in a fixed-height scrollable container.
Long Content
Ideal for terms of service, policy text, or any prose that must be contained within a fixed-size box.
Properties
ScrollArea
| Property | Type | Default | Description |
|---|---|---|---|
className | string | - | Additional CSS classes applied to the root element. Use to set h-* / w-* constraints. |
children | ReactNode | - | Scrollable content. Include a <ScrollBar> child for custom orientation. |
All props from @radix-ui/react-scroll-area Root are forwarded.
ScrollBar
| Property | Type | Default | Description |
|---|---|---|---|
orientation | "vertical" | "horizontal" | "vertical" | Direction of the scrollbar. |
className | string | - | Additional CSS classes for the scrollbar track. |
A vertical ScrollBar is rendered automatically inside ScrollArea. Add a second <ScrollBar orientation="horizontal" /> as a child when horizontal scrolling is needed.