ScrollArea
Custom-styled scrollable container built on Radix UI with themed scrollbar and support for vertical, horizontal, or both axes.
Live Demo
Vertical
Horizontal
Props
| Prop | Type | Default | Description |
|---|---|---|---|
orientation | 'vertical' | 'horizontal' | 'both' | 'vertical' | Which scrollbar(s) to render. |
children | React.ReactNode | — | Scrollable content. |
className | string | — | Extra CSS class on the root element. |
Usage
import { ScrollArea } from '@ghiberti85/ui'
// Vertical (default)
<ScrollArea style={{ height: 200 }}>
{items.map(i => <div key={i}>{i}</div>)}
</ScrollArea>
// Horizontal
<ScrollArea orientation="horizontal" style={{ width: 300 }}>
<div style={{ display: 'flex', gap: 8, width: 'max-content' }}>
{tags.map(t => <span key={t}>{t}</span>)}
</div>
</ScrollArea>
// Both axes
<ScrollArea orientation="both" style={{ height: 200, width: 300 }}>
<div style={{ width: 600, height: 600 }}>Large content</div>
</ScrollArea>