Scroll Area

A cross-browser solution for styled scroll areas: it relies on native scrolling for accessibility and performance while exposing parts (viewport, scrollbar, thumb, corner) for styling.

@radix-ui/react-scroll-area

lucide-react

Installation


1

Install the following dependencies:

npx shadcn@latest add https://sbthemes.com/r/scroll-area.json

Examples


Default

Horizontal Scrolling


API Reference

Root

Contains all the parts of a scroll area.

PropTypeDefault
asChildbooleanfalse
scrollHideDelaynumber600

Scrollbar

The vertical scrollbar. Add a second Scrollbar with an orientation prop to enable horizontal scrolling.

PropTypeDefault
asChildbooleanfalse
orientationvertical, horizontalvertical
Data attributeValues
[data-state]visible, hidden
[data-orientation]vertical, horizontal