Atomx Docs
Components

Scroll Area

Augments native scroll functionality for custom, cross-browser styling, built on Radix UI.

Install

npx shadcn@latest add https://atomx.acau.net/r/scroll-area.json

Usage

Wrap any overflowing content in ScrollArea to get custom-styled scrollbars that match the design system across browsers. Set a fixed height (or max-height) on the ScrollArea so its viewport has something to scroll within.

<ScrollArea className="h-72 w-48 rounded-md border">
  <div className="p-4">{children}</div>
</ScrollArea>

Preview

Long list

Row 1
Row 2
Row 3
Row 4
Row 5
Row 6
Row 7
Row 8
Row 9
Row 10
Row 11
Row 12
Row 13
Row 14
Row 15
Row 16
Row 17
Row 18
Row 19
Row 20
Row 21
Row 22
Row 23
Row 24
Row 25
Row 26
Row 27
Row 28
Row 29
Row 30

Props

ScrollArea extends React.ComponentPropsWithoutRef<typeof ScrollAreaPrimitive.Root>.

PropTypeNotes
type"auto" | "always" | "scroll" | "hover"When scrollbars are visible. Defaults to "hover".
scrollHideDelaynumberDelay before scrollbars hide, in ms.
dir"ltr" | "rtl"Reading direction.

ScrollBar extends React.ComponentPropsWithoutRef<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>.

PropTypeNotes
orientation"vertical" | "horizontal"Scrollbar axis. Defaults to "vertical".