◇
ScrollArea
10 partsAnatomy
Import the parts and compose them. Each part forwards attributes to its underlying element.
vue
import {
ScrollAreaCorner,
ScrollAreaRoot,
ScrollAreaScrollbar,
ScrollAreaScrollbarAuto,
ScrollAreaScrollbarHover,
ScrollAreaScrollbarImpl,
ScrollAreaScrollbarScroll,
ScrollAreaScrollbarVisible,
ScrollAreaThumb,
ScrollAreaViewport,
} from '@robonen/primitives/scroll-area';
<ScrollAreaCorner>
<ScrollAreaRoot />
<ScrollAreaScrollbar />
<ScrollAreaScrollbarAuto />
<ScrollAreaScrollbarHover />
<ScrollAreaScrollbarImpl />
<ScrollAreaScrollbarScroll />
<ScrollAreaScrollbarVisible />
<ScrollAreaThumb />
<ScrollAreaViewport />
</ScrollAreaCorner>API Reference
ScrollAreaCorner
CornerNo props or events — renders its element and forwards attributes.
ScrollAreaRoot
Root| Prop | Type | Description |
|---|---|---|
type? | ScrollAreaType | Visibility behaviour for scrollbars. - `auto`: visible whenever content overflows. - `always`: always visible. - `scroll`: visible while the user is scrolling, then hides after `scrollHideDelay`. - `hover`: visible while the pointer is over the root, then hides after `scrollHideDelay`. |
dir? | 'ltr' | 'rtl' | Reading direction. Inherits from `ConfigProvider` when omitted. |
scrollHideDelay? | number | For `type='scroll'` and `type='hover'`, the time in ms before scrollbars hide after the user stops interacting. |
ScrollAreaScrollbar
Scrollbar| Prop | Type | Description |
|---|---|---|
orientation? | 'horizontal' | 'vertical' | — |
forceMount? | boolean | Keep mounted regardless of visibility state. |
ScrollAreaScrollbarAuto
ScrollbarAuto| Prop | Type | Description |
|---|---|---|
orientation? | 'horizontal' | 'vertical' | — |
forceMount? | boolean | — |
ScrollAreaScrollbarHover
ScrollbarHover| Prop | Type | Description |
|---|---|---|
orientation? | 'horizontal' | 'vertical' | — |
forceMount? | boolean | — |
ScrollAreaScrollbarImpl
ScrollbarImpl| Prop | Type | Description |
|---|---|---|
orientation | 'horizontal' | 'vertical' | — |
sizes | ScrollAreaSizes | — |
hasThumb | boolean | — |
Emits
| Event | Payload |
|---|---|
sizesChange | [sizes: ScrollAreaSizes] |
wheelScroll | [event: WheelEvent, maxScroll: number] |
dragScroll | [pointerPos: number] |
thumbPositionChange | [] |
registerScrollbar | [el: HTMLElement | null] |
ScrollAreaScrollbarScroll
ScrollbarScroll| Prop | Type | Description |
|---|---|---|
orientation? | 'horizontal' | 'vertical' | — |
forceMount? | boolean | — |
ScrollAreaScrollbarVisible
ScrollbarVisibleNo props or events — renders its element and forwards attributes.
ScrollAreaThumb
ThumbNo props or events — renders its element and forwards attributes.
ScrollAreaViewport
Viewport| Prop | Type | Description |
|---|---|---|
nonce? | string | Inline `nonce` attribute applied to the injected style tag (CSP support). |