ScrollArea
Scrollable container with custom design-system scrollbars. children are
placed inside a Radix viewport, so give the root (or viewportClassName) an
explicit height/width for scrolling to engage.
Import from "@desk/ui/components/scroll-area".
Usage
import { ScrollArea, ScrollBar } from "@desk/ui/components/scroll-area";Best practices
Give the root (or
viewportClassName) an explicit height/width — without a bounded size the content never overflows and the custom scrollbar never engages.ScrollArearenders its ownScrollBar; reach forScrollBardirectly only when hand-composing a Radix scroll area.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| allowOverflow | boolean | Allow content to visually overflow the root container. | |
| orientation | Orientation | Orientation of the scrollbar. Defaults to "vertical". Set to "horizontal" for horizontal scrolling. | |
| hideScrollbar | boolean | Hide the scrollbar completely while maintaining scroll functionality | |
| viewportClassName | string | Additional classes for the viewport (scrolling container) |
Also exports
- component
ScrollBar
Composition
Used by