Scroll Area

Native-scrolling container that keeps wheel, touch momentum and keyboard scrolling but hides the browser bar behind an overlay thumb (vertical, horizontal or both) that fades in on hover or scroll and out when idle, drags, pages on track click, and pairs with distance-scaled edge fade masks, all sized by a ResizeObserver.

Preview

Scroll Area preview width

Install

Add it with the shadcn CLI, or copy the source manually.

$ bunx --bun shadcn add @karaui/scroll-area
@karaui not found? Add it to components.json
{
  "registries": {
    "@karaui": "https://karaui.kamisama-v0.my.id/r/{name}.json"
  }
}

@karaui is in shadcn's public registry directory, so the latest CLI needs no setup. On an older CLI, merge this into the existing file once and every @karaui/… install resolves.

API Reference

orientation?
"both" | "horizontal" | "vertical"
vertical
type?
"scroll" | "hover" | "always"
hover
scrollHideDelay?
number

Milliseconds of idle before the thumb fades out.

700
fadeEdges?
boolean

Fade the content out at edges that have more content beyond them.

true
fadeSize?
number

Maximum fade length in px; it grows with the distance from the edge.

28
viewportClassName?
string

Class for the scrolling viewport (padding usually belongs here).

—
viewportRef?
Ref<HTMLElement | null>

Ref to the native scroll container, for `scrollTo` or virtualizers.

—
aria-label?
string

Accessible name for the focusable scroll region.

—
className?
string
—

Updated