GhostScrollArea reference
Package: @ghostvue/vue. Status: experimental (stability policy).
Headless native overflow container. useGhostScrollArea owns overflow measurement, tabindex policy, data-type hooks, and opt-in stick-to-bottom following (stickToBottom, v-model:stuck, scrollToBottom()); GhostScrollArea is the scroll root with a default slot. Native keyboard scrolling is left to the platform. Themed recipes live on @ghostvue/themes.
Generated from the component manifest. Edit the manifest or Vue source, then rebuild the docs.
Props
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
as | 'div' | "div" | No | Scroll root host. Closed union; only div is supported initially. |
label | string | — | No | When the root is a tab stop with no inner focusables, sets role=region and aria-label. |
orientation | GhostScrollAreaOrientation | "vertical" | No | Which axes may scroll when content exceeds the box. |
stickToBottom | boolean | false | No | Follow new content at the bottom while the reader is at the bottom, and stop following when the reader scrolls up. Applies to `vertical` and `both`; ignored with a development warning for `horizontal`. |
stuck | boolean | — | No | Whether the view is following new content (`v-model:stuck`). Omit for uncontrolled mode, which starts `true`. Ignored while `stickToBottom` is not effective. |
type | GhostScrollAreaOverflowType | "auto" | No | Native overflow mode on enabled axes: auto or scroll. |
Emits
None declared.
Models
| Prop | Event | Type | Description |
|---|---|---|---|
stuck | update:stuck | boolean | v-model:stuck. Whether the view follows new content. Omit for uncontrolled mode, which starts true. The component emits false when the reader scrolls up and true when they return to the bottom or scrollToBottom() runs. |
Slots
| Name | Description |
|---|---|
default | Scrollable content inside the native overflow root. |
Slot props: default
None declared.
Exposed members
| Name | Type | Description |
|---|---|---|
element | HTMLElement | Scroll root element. |
scrollToBottom | (options?: GhostScrollAreaScrollToBottomOptions) => void | Scrolls the root to its maximum `scrollTop`. With `stickToBottom` effective, it first sets `stuck` to `true` so following resumes. No-op before mount and after unmount. |
Parts and data attributes
| Attribute | Value | Description |
|---|---|---|
data-part | root | Native overflow host. data-orientation and data-type configure axes; data-overflow reflects measured overflow (none, vertical, horizontal, both); data-stuck reflects following while stickToBottom is effective. |
data-orientation | vertical, horizontal, both | Resolved orientation on the root. Always present. |
data-stuck | true, false | Present only while stickToBottom is effective: true while following new content, false after the reader scrolls up. |
CSS variables
None declared.
Accessibility
Role: native scrolling. APG pattern: https://www.w3.org/WAI/ARIA/apg/.
Required ARIA attributes: aria-label.
Keyboard
| Key | Action | Automated browser test |
|---|---|---|
ArrowUp | Native scroll up on the focused root. With stickToBottom, holds following and releases on the resulting scroll. | Not reviewed |
PageUp | Native page up on the focused root. With stickToBottom, holds following and releases on the resulting scroll. | Not reviewed |
Home | Native scroll to top on the focused root. With stickToBottom, holds following and releases on the resulting scroll. | Not reviewed |
Shift+Space | Native page up on the focused root. With stickToBottom, holds following and releases on the resulting scroll. | Not reviewed |
End | Native scroll to bottom on the focused root. With stickToBottom, re-engages following. | Not reviewed |
Verification
Each category is reviewed separately. Automated keyboard and axe results do not attest manual or assistive-technology review.
| Category | Status | Evidence |
|---|---|---|
| Automated keyboard | Not reviewed | No declared key is mapped to a browser test yet. |
| Manual interaction | Not reviewed | No review recorded. |
| Assistive technology | Not reviewed | No review recorded. |
Examples
scroll-area/basic
Bounded vertical overflow with native scrolling.
scroll-area/composable
Same contract as GhostScrollArea on a native host.
scroll-area/themed
Inbox region sized by its layout, with native scrollbar containment on @ghostvue/themes.