scroll-area
Scroll Area
Holds content that scrolls inside a fixed area, vertically, horizontally or both, with a slim bar that shows on hover.
States: Default, Focus
Parts
| Part | File | Does |
|---|---|---|
| ScrollArea | ScrollArea.vue | Holds content that scrolls within a fixed area. |
| ScrollBar | ScrollBar.vue | Shows the scroll position and lets the user drag to scroll. |
Anatomy
<ScrollArea>
<ScrollBar />
</ScrollArea>Styling
| Part | Recipe |
|---|---|
| ScrollArea | scroll-area-viewport |
| ScrollBar | scroll-area-scrollbar |
| ScrollBar | scroll-area-thumb |
Install
Writes 3 files into components/ui/scroll-area/. For agents, npx @frontic/ui docs scroll-area prints this reference as markdown; the MCP server serves the same.
- npm packages
- @vueuse/core
- class-variance-authority
- reka-ui
API reference
ScrollArea ScrollArea.vue
Holds content that scrolls within a fixed area.
| Prop | Type | Default | |
|---|---|---|---|
| type | ScrollType | 'hover' | |
| dir | Direction | — | |
| scrollHideDelay | number | 600 | |
| asChild | boolean | false | |
| as | AsTag | Component | — | |
| class | ClassValue | — | |
| orientation | 'vertical' | 'horizontal' | 'both' | 'vertical' | |
| CSS variable | Description |
|---|---|
| --reka-scroll-area-corner-height | The height of the corner where the two scrollbars meet, in pixels. |
| --reka-scroll-area-corner-width | The width of the corner where the two scrollbars meet, in pixels. |
| Recipe scroll-area-viewport | Sets | |
|---|---|---|
| base: scroll-area-viewport | 2 properties | |
ScrollBar ScrollBar.vue
Example