Scroll Area
Augments native scroll functionality for custom, cross-browser styling.
Installation
pnpm dlx cubix@latest add scroll-area --base ariaUsage
import { ScrollArea, ScrollBar } from "@/components/cubix/scroll-area"<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
└── ScrollBarHorizontal
Use ScrollBar with orientation="horizontal" for horizontal scrolling.
API Reference
See also the Base UI Scroll Area documentation for primitive props.
ScrollArea
| Prop | Type | Default | Description |
|---|---|---|---|
| className | string | - | Additional Tailwind classes merged with the component styles (last one wins). |
| children | React.ReactNode | - | Content rendered inside the scroll viewport. |
ScrollBar
| Prop | Type | Default | Description |
|---|---|---|---|
| orientation | "vertical" | "horizontal" | "vertical" | Direction of the scrollbar. |
| className | string | - | Additional Tailwind classes merged with the component styles (last one wins). |