Components
Scroll area
Vertical scroll container with an overlay scrollbar and edges that fade while there is more to scroll.
import { ScrollArea } from "@openperf/deft";
<ScrollArea.Root className="max-h-64">
<ul className="pr-2">{rows}</ul>
</ScrollArea.Root>;Height
Cap the height with a max-h-* class on ScrollArea.Root: the area grows with its content and starts to scroll once the cap is reached. Scrolling is vertical only and does not chain to the page behind it.
Sidebar.Content in the Sidebar already scrolls on its own, and the page scrolls natively — wrap neither.
Scrollbar and fade
| Element | Behaviour |
|---|---|
| Scrollbar | 4px thumb over the right edge of the content, visible only while the pointer is over the area or while it scrolls. |
| Fade | Up to 24px of content fades out at the top and the bottom while there is more to scroll that way; an edge at its end stays sharp. |
The thumb overlays the content, so leave right padding on it as the snippet does.
Stick to bottom
For a list that grows at its end, such as a console or a log, stickToBottom keeps the newest row in view. Once the reader scrolls up, the area stays where they left it until they scroll back to the bottom.
API
className and the remaining props go to Base UI ScrollArea.Root.
Prop
Type