Scroll Area

Augments native scroll functionality for custom, cross-browser styling.

Installation

pnpm dlx cubix@latest add scroll-area --base aria

Usage

Import
import { ScrollArea, ScrollBar } from "@/components/cubix/scroll-area"
Example
<ScrollArea className="h-[200px] w-[350px] rounded-md border p-4">
  Your scrollable content here.
</ScrollArea>

Composition

Use the following composition to build a ScrollArea:

 
ScrollArea
└── ScrollBar

Horizontal

Use ScrollBar with orientation="horizontal" for horizontal scrolling.

API Reference

See also the Base UI Scroll Area documentation for primitive props.

ScrollArea

PropTypeDefaultDescription
classNamestring-Additional Tailwind classes merged with the component styles (last one wins).
childrenReact.ReactNode-Content rendered inside the scroll viewport.

ScrollBar

PropTypeDefaultDescription
orientation"vertical" | "horizontal""vertical"Direction of the scrollbar.
classNamestring-Additional Tailwind classes merged with the component styles (last one wins).