039
Scroll Area
LayoutCustomize
Axis
Code
<ScrollArea className="h-40 w-64 border border-border p-3">
{lines.map((l) => <p key={l}>{l}</p>)}
</ScrollArea>Install
npx shadcn@latest add https://components.haedong.dev/r/scroll-area.json
Props
Extends the native div props. Give it a size (h-*, max-h-*, w-*) and it scrolls on whichever axis overflows. Only the scrollbar is styled — the thumb is a page-surface plate with a full-strength hairline that inverts on hover; wheel, touch, keyboard and assistive tech scrolling are the browser's. Firefox has no scrollbar parts and shows its thin scrollbar in the foreground color instead.
| Prop | Type | Description |
|---|---|---|
| className | string | Size and box: h-40 w-64 border border-border p-3. |
| children | ReactNode | The content that may overflow. |