Skip to content

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.

All component references

Props ​

NameTypeDefaultRequiredDescription
as'div'"div"NoScroll root host. Closed union; only div is supported initially.
labelstring—NoWhen the root is a tab stop with no inner focusables, sets role=region and aria-label.
orientationGhostScrollAreaOrientation"vertical"NoWhich axes may scroll when content exceeds the box.
stickToBottombooleanfalseNoFollow 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`.
stuckboolean—NoWhether the view is following new content (`v-model:stuck`). Omit for uncontrolled mode, which starts `true`. Ignored while `stickToBottom` is not effective.
typeGhostScrollAreaOverflowType"auto"NoNative overflow mode on enabled axes: auto or scroll.

Emits ​

None declared.

Models ​

PropEventTypeDescription
stuckupdate:stuckbooleanv-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 ​

NameDescription
defaultScrollable content inside the native overflow root.

Slot props: default ​

None declared.

Exposed members ​

NameTypeDescription
elementHTMLElementScroll root element.
scrollToBottom(options?: GhostScrollAreaScrollToBottomOptions) => voidScrolls 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 ​

AttributeValueDescription
data-partrootNative 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-orientationvertical, horizontal, bothResolved orientation on the root. Always present.
data-stucktrue, falsePresent 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 ​

KeyActionAutomated browser test
ArrowUpNative scroll up on the focused root. With stickToBottom, holds following and releases on the resulting scroll.Not reviewed
PageUpNative page up on the focused root. With stickToBottom, holds following and releases on the resulting scroll.Not reviewed
HomeNative scroll to top on the focused root. With stickToBottom, holds following and releases on the resulting scroll.Not reviewed
Shift+SpaceNative page up on the focused root. With stickToBottom, holds following and releases on the resulting scroll.Not reviewed
EndNative 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.

CategoryStatusEvidence
Automated keyboardNot reviewedNo declared key is mapped to a browser test yet.
Manual interactionNot reviewedNo review recorded.
Assistive technologyNot reviewedNo review recorded.

Examples ​

scroll-area/basic ​

Example source

Basic Headless

Bounded vertical overflow with native scrolling.

Event 1: backup checkpoint completed.

Event 2: backup checkpoint completed.

Event 3: backup checkpoint completed.

Event 4: backup checkpoint completed.

Event 5: backup checkpoint completed.

Event 6: backup checkpoint completed.

Event 7: backup checkpoint completed.

Event 8: backup checkpoint completed.

Event 9: backup checkpoint completed.

Event 10: backup checkpoint completed.

Event 11: backup checkpoint completed.

Event 12: backup checkpoint completed.

scroll-area/composable ​

Example source

Composable Headless

Same contract as GhostScrollArea on a native host.

Line 1

Line 2

Line 3

Line 4

Line 5

Line 6

Line 7

Line 8

scroll-area/themed ​

Example source

Themed

Inbox region sized by its layout, with native scrollbar containment on @ghostvue/themes.

  • BillingInvoice INV-2048 is ready
  • Ada LovelaceReview requested on the tokens PR
  • StatusScheduled maintenance on Saturday
  • Grace HopperRelease notes draft for v2.15
  • SecurityNew sign-in from Berlin
  • Alan TuringVisual baselines updated
  • SupportTicket 3141 was resolved
  • Margaret HamiltonCanary rollback guard enabled