A consistent thin scrollbar for bounded regions — activity feeds, option lists, chip strips, code blocks — with optional edge fades. Native scrolling is kept.
Recent activity
Installation
The whole kit as one package — get updates by bumping the version. Add the styles to globals.css: @import "@vamos-ui/react/styles.css";
Usage
import { ScrollArea } from "@vamos-ui/react";
<ScrollArea maxHeight={320} fade aria-label="Recent activity">…</ScrollArea>Keep the page body and the Sidebar on native scrolling. ScrollArea is for embedded, bounded regions (performance, iOS momentum).
The viewport is keyboard-focusable only when its content has nothing focusable of its own.
Examples
Horizontal chip strip
orientation="horizontal" with fade: the mask disappears at each edge. Give the content w-max.
Both directions (code)
orientation="both"; type="auto" shows the bars whenever content overflows.
In a floating panel
Long option lists inside popovers and menus. The thumb uses the foreground at 25%, so it reads on glass and solid.
API
ScrollArea
| Prop | Type | Default |
|---|---|---|
orientationWhich scrollbars to render. | "vertical" | "horizontal" | "both" | "vertical" |
maxHeightMax viewport height (number = px); grows with content up to it. | number | string | — |
fadeEdge fade mask on the scrolling axis (not for both). | boolean | false |
typeWhen the scrollbars are visible. | "hover" | "scroll" | "auto" | "always" | "hover" |
sizeScrollbar thickness. | "sm" | "md" | "sm" |
scrollHideDelayms before hover / scroll bars hide. | number | 600 |
viewportRefThe scrolling element (scroll position, virtualisation). | Ref<HTMLDivElement> | — |
viewportClassNameClass names for the viewport. | string | — |
aria-labelNames the region (adds role="region"). Recommended when the region is focusable. | string | — |
dirThe vertical bar moves to the left in RTL. | "ltr" | "rtl" | — |
ScrollBar
| Prop | Type | Default |
|---|---|---|
orientationFor custom layouts; ScrollArea renders its bars automatically. | "vertical" | "horizontal" | "vertical" |
sizeOverrides the area's size. | "sm" | "md" | — |