Scroll Area
A container with custom-styled scrollbars for managing overflow content in both directions.
Preview
Destination List
Usage
tsx
import { ScrollArea, ScrollBar } from "zostel-ui";
{/* Vertical scrolling */}
<ScrollArea className="h-64 w-56 rounded-md border">
<div className="p-4">
{items.map((item) => (
<div key={item}>{item}</div>
))}
</div>
</ScrollArea>
{/* Horizontal scrolling */}
<ScrollArea className="w-full whitespace-nowrap rounded-md border">
<div className="flex gap-4 p-4">
{items.map((item) => (
<div key={item} className="w-32 shrink-0">{item}</div>
))}
</div>
<ScrollBar orientation="horizontal" />
</ScrollArea>Props
| Prop | Type | Default | Description |
|---|---|---|---|
className | string | — | CSS classes for the scroll area container |
children | ReactNode | — | Scrollable content |
orientation | "vertical" | "horizontal" | "vertical" | ScrollBar orientation (on ScrollBar) |
classNameType:
stringDefault: —
CSS classes for the scroll area container
childrenType:
ReactNodeDefault: —
Scrollable content
orientationType:
"vertical" | "horizontal"Default: "vertical"
ScrollBar orientation (on ScrollBar)