Loading...
Installation
Install the following dependencies:
Copy and paste the following code into your project.
Loading...
Update the import paths to match your project setup.
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
| Prop | Type | Default | Description |
|---|---|---|---|
id | string | undefined | — | Unique identifier used to connect the component parts. |
ids | ElementIds | — | Overrides generated identifiers for individual parts. |
overflowEdgeThreshold | number | 0 | Distance from an edge before overflow data attributes change. |
Parts
| Export | Purpose |
|---|---|
ScrollAreaComponent | Styled ScrollArea root with a default viewport, vertical scrollbar, and corner. |
ScrollBarComponent | Styled scrollbar with an automatically rendered thumb. |
ScrollAreaContentDirective | Styled container for the component's main content. |
ScrollAreaCornerDirective | Styled ScrollAreaCorner part. |
ScrollAreaThumbDirective | Styled ScrollAreaThumb part. |
ScrollAreaViewportDirective | Styled ScrollAreaViewport part. |
Context, Hooks, and Types
| Export | API |
|---|---|
ScrollAreaContext | Render-prop component that exposes component state and actions. |
ScrollAreaRootProvider | Provides an externally created API to the component tree. |
useScrollArea | Creates or accesses the component API. |
useScrollAreaContext | Returns the nearest component API. |
Angular
React
Solid
Svelte
Vue