Scroll area
A scrollable region with a thin scrollbar in the village's colours, keyboard-focusable like native scrolling.
Installation
Or with the shadcn CLI, from the registry:
Usage
Horizontal
The area has a vertical scrollbar. Add <ScrollBar orientation="horizontal" /> inside it for wide content.
Villages
The thumb is --border coloured and follows the village's radius.
Accessibility
- The viewport is focusable, so the keyboard scrolls it with the arrows and Page Up / Page Down.
- Give the area an
aria-labelwhen its content doesn't name itself.
API reference
The parts of Base UI's Scroll Area:
| Part | Notes |
|---|---|
ScrollArea | root, viewport, a vertical scrollbar and the corner |
ScrollBar | orientation: "vertical" (default) or "horizontal" |