Components
Scroll Area
A thin overlay scrollbar and an edge fade that hints at more content. Touch devices keep native momentum and rubber-banding.
Usage
Nested overflow that needs a thin thumb and an edge hint.
Do and don't
- Do. Constrain the outer box and put scroll-fade on the viewport.
- Don't. Wrap short content or hide scrollable content without an affordance.
The install writes the component and appends the .scroll-fade and .scroll-fade-x mask utilities, the @property --sf-start/--sf-end registrations, named keyframes and a thin scrollbar rule to your globals.css.
Props
orientation="vertical" | "horizontal" | "both"; vertical by default.viewportClassName; lands on the inner scrolling viewport. Putscroll-fadeorscroll-fade-xhere.className; the outer box. Constrain height or width here.ScrollBaris exported for custom scrollbar placement.
How it works
- Desktop uses the Base UI scroll area; scrollbars stay mounted while scrollable and change opacity with hover or scroll.
- On touch devices the primitive is skipped, so native overflow physics remain.
- The thumb reads the
--overlayRGB triplet, so it adapts to both appearance modes without new tokens.
Related
Pair with Table for long vertical lists. The thumb color is part of the Colors token set.