Scroll Area
A Base UI scroll viewport with styled custom scrollbars.
A Base UI scroll viewport with styled custom scrollbars.
Backed by Base UI Scroll Area for upstream behavior and configuration. Zenos owns the public API, styling, and composition shown on this page.
Import
Section titled “Import”import { ScrollArea } from "@zentara-co/zenos-ui";Constrain the viewport
Section titled “Constrain the viewport”Give ScrollArea.Root (or the convenient ScrollArea wrapper) a fixed height or width so content can overflow. The default composition includes a vertical scrollbar with keepMounted so overflow is measured reliably in constrained layouts.
Horizontal
Section titled “Horizontal”Use the compound parts when the scrolling axis differs from the convenient vertical composition. Keep wide children from shrinking so they produce horizontal overflow.
Both axes
Section titled “Both axes”Render one scrollbar for each axis and add ScrollArea.Corner where they meet. This composition is useful for bounded data surfaces with content wider and taller than the viewport.
Custom styling
Section titled “Custom styling”Every compound part accepts className, so the bounded surface, content, scrollbar track, and thumb can share a branded treatment without changing scrolling behavior. Compose ScrollArea.Thumb explicitly when its styling differs from the default thumb. Stable data-slot attributes are also available for parent-scoped selectors.
ScrollArea.Root ScrollArea.Viewport ScrollArea.Content ScrollArea.Scrollbar ScrollArea.Thumb ScrollArea.Corner
API
| Prop | Type | Default | Description |
|---|---|---|---|
children | ReactNode | — | Scrollable content used by the convenient composition. |
Scrollbar.orientation | "vertical" | "horizontal" | "vertical" | Axis controlled by this scrollbar. |
Scrollbar.children | ReactNode | — | Custom thumb content. A styled Thumb is supplied by default. |
Scrollbar.keepMounted | boolean | true | Keeps the scrollbar mounted while overflow is measured in constrained layouts. |
native props | React.Base UI ScrollArea props | — | Forwards native attributes, events, aria-*, data-*, className, style, and ref. |
Unless narrowed above, each DOM-rendering part also accepts its underlying native or Base UI props,
including className, style, aria-*, and data-*.
Accessibility
Section titled “Accessibility”The viewport retains native scrolling behavior for wheel, touch, and keyboard input. Give a focused viewport an accessible name when its surrounding context does not already describe the region. Keep ordinary page content in the document scroll flow; use ScrollArea for intentionally bounded regions. Scrollbar thumbs are visual pointer controls and do not replace keyboard scrolling of the viewport.