ScrollArea
Usable scrolling with thin overlay scrollbars, without hiding content or controls.
Base UI reference ↗Installation
Run it from the root of a project already set up with zunoui init.
npx zunoui@latest add scroll-areaDependencies
What add scroll-area installs alongside the component. The CLI skips any you already have in a compatible version.
ZUNO registry
@zuno/utils
npm
@base-ui/[email protected]
Examples
3 examples · 1 componentVertical list
A fixed-height list named with aria-label.
Horizontal row
orientation="horizontal" for a row of cards.
Both directions
Wide and tall content; both scrollbars and the corner.
API reference
Keeps the props, events and refs of the matching Base UI primitive, plus ZUNO's styles.
| Prop | Type | Default |
|---|---|---|
orientationWhich scrollbars render; both adds the corner. | "vertical" | "horizontal" | "both" | "vertical" |
classNameSize the root (h-72, max-h-96…); the viewport fills it. | string | — |
overflowEdgeThresholdPixels before data-overflow-*-start/end flip, for fade edges. | number | 0 |
ScrollBarExported for custom layouts; decorative (aria-hidden). | div | — |
States
The states that apply to this component and their visual treatment.
| State | Treatment |
|---|---|
| Idle | Scrollbars hidden; content fully visible. |
| Hover / scrolling | Thin scrollbar fades in. |
| Focus | Inset outline on the viewport when it is focusable. |
| No overflow | No scrollbar and no tab stop. |
Accessibility
Scrolling stays native: wheel, touch, keyboard and assistive tech work as in any overflow container.
The viewport becomes focusable only when it overflows, so keyboard users can scroll it with the arrow keys even when it has no focusable content (a gap in Safari's native behavior).
Pass aria-label (or aria-labelledby) when it holds a list or other meaningful content: the root then becomes a named region. The scrollbars are decorative.
Overlay scrollbars never cover content: they show on hover or while scrolling and the thumb uses the border token.