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. |
Parts
| Export | Purpose |
|---|---|
ScrollArea | Styled ScrollArea part. |
ScrollBar | Styled ScrollBar part. |
ScrollAreaContent | Container for the component's main content. |
ScrollAreaCorner | Styled ScrollAreaCorner part. |
ScrollAreaThumb | Styled ScrollAreaThumb part. |
ScrollAreaViewport | 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