Search documentation

Search the documentation and open a page.

Augments native scroll functionality for custom, cross-browser styling.

Loading...

Installation

pnpm dlx shadcn@latest add @wirekyt/scroll-area

Composition

ScrollArea ├── ScrollAreaViewport │ └── ScrollAreaContent ├── ScrollBar │ └── ScrollAreaThumb └── ScrollAreaCorner (optional)

Examples

Both Axes

Loading...

Default

Loading...

In A Popover

Loading...

Overflow Edges

Loading...

Scroll To

Loading...

Sticky Headers

Loading...

API Reference

Scroll Area

PropTypeDefaultDescription
idstring | undefined—Unique identifier used to connect the component parts.
idsElementIds—Overrides generated identifiers for individual parts.
overflowEdgeThresholdnumber0Distance from an edge before overflow data attributes change.

Parts

ExportPurpose
ScrollAreaComponentStyled ScrollArea root with a default viewport, vertical scrollbar, and corner.
ScrollBarComponentStyled scrollbar with an automatically rendered thumb.
ScrollAreaContentDirectiveStyled container for the component's main content.
ScrollAreaCornerDirectiveStyled ScrollAreaCorner part.
ScrollAreaThumbDirectiveStyled ScrollAreaThumb part.
ScrollAreaViewportDirectiveStyled ScrollAreaViewport part.

Context, Hooks, and Types

ExportAPI
ScrollAreaContextRender-prop component that exposes component state and actions.
ScrollAreaRootProviderProvides an externally created API to the component tree.
useScrollAreaCreates or accesses the component API.
useScrollAreaContextReturns the nearest component API.