Skip to content

GhostScrollArea specification ​

Status: Approved (see the frontmatter evidence). Originally proposed for GHO-84, where spec and implementation shipped together.

Stick-to-bottom amendment (0.4.0). Approved on 2026-12-01 by @zprue743, together with the rest of this specification. Adds opt-in following for chat logs and other streaming views: the stickToBottom prop, the stuck model, and the scrollToBottom() method. The rules are decisions ST1–ST12. The rest of this contract is unchanged. The chat pieces that compose with it, and the end-to-end streaming chat trace, are in the GhostChatMessage specification.

Purpose and user problems ​

GhostScrollArea is a constrained overflow container with predictable layout and accessibility behavior. It clips or scrolls content that exceeds a bounded region without custom scrollbar widgets, sticky orchestration, or virtualization.

Sighted users scroll with pointer, trackpad, or native scrollbars. Keyboard users can reach overflowed content when the region has no other focusable descendants, using the same keys as a native scrollable element. Assistive technology encounters a scrollable region with an accessible name when the root is in the tab order.

Immediate consumers include tall lists in side panels, bounded dialog bodies, and horizontally overflowed table wrappers ahead of GhostDataTable. Those need native scrolling, stable layout, and axe-clean focus rules (scrollable-region-focusable).

Chat logs, build output, and other streaming views need one more behavior: the view follows new content at the bottom while the reader is at the bottom, and stops following as soon as the reader scrolls up to read something earlier. Without it, apps set scrollTop by hand after every chunk through the exposed element, and each one handles the reader scrolling up (or fails to) in its own way. stickToBottom owns that behavior.

Non-goals ​

  • Custom scrollbar rendering, drag-to-scroll thumbs, or scrollbar-only styling as a requirement. Themed CSS may style native scrollbars where the platform allows it; consumers are not forced to replace native scrolling.
  • Virtualization, infinite scroll, or scroll-position persistence.
  • Keeping the reader's place when older history is prepended above. Native scroll anchoring (overflow-anchor) handles this where the engine supports it; the component neither enables nor disables it.
  • Sticking to the start or to the inline end. stickToBottom follows the physical bottom of a vertical scroller only. Vertical writing modes are not supported.
  • Animated following. Following is always instant; only an explicit scrollToBottom({ behavior: 'smooth' }) animates.
  • Announcing new content. The scroll area adds no live region; the chat recipe owns announcements (see the chat specification).
  • Sticky rows/columns, scroll syncing, or DataTable-specific orchestration.
  • Window-level scroll locking (useScrollLock stays separate).
  • Split panes / window splitters (APG window splitter pattern).
  • Focus trapping inside the region; parent widgets own that when needed.
  • Shadow DOM scroll portals or nested viewport/corner/scrollbar part trees.

Public API ​

Props and configuration ​

Headless @ghostvue/vue GhostScrollArea / useGhostScrollArea:

PropTypeDefaultContract
orientation'vertical' | 'horizontal' | 'both''vertical'Which axes may scroll. Vertical is overflow-y; horizontal is overflow-x; both allow either axis when content exceeds the box.
type'auto' | 'scroll''auto'Maps to native overflow-*: auto vs scroll. auto shows scrollbars when needed; scroll always reserves the scrollable overflow mode on enabled axes.
as'div''div'Host element. Closed union; widened only additively.
labelstringundefinedWhen the root is a tab stop with no tabbable descendants, sets role="region" and aria-label. Provide whenever case (1) applies so the name is valid for ARIA.

Stick-to-bottom props (amendment):

PropTypeDefaultContract
stickToBottombooleanfalseOpt in to following new content at the bottom (ST1). Applies to vertical and both. With horizontal it is ignored and a development warning is logged once per instance.
stuckbooleanomittedv-model:stuck. Whether the view is following. Omit for uncontrolled mode, which starts true. Ignored while stickToBottom is not effective. See v-model contracts.
ts
type GhostScrollAreaElement = 'div'
type GhostScrollAreaOrientation = 'vertical' | 'horizontal' | 'both'
type GhostScrollAreaOverflowType = 'auto' | 'scroll'

interface GhostScrollAreaScrollToBottomOptions {
  /** `'smooth'` falls back to `'auto'` under `prefers-reduced-motion: reduce`. */
  behavior?: 'auto' | 'smooth'
}

useGhostScrollArea gains three options and two return values:

ts
interface UseGhostScrollAreaOptions {
  // existing: as, label, orientation, type
  stickToBottom?: MaybeRefOrGetter<boolean | undefined>
  /** Controlled stuck state; `undefined` is uncontrolled (starts `true`). */
  stuck?: MaybeRefOrGetter<boolean | undefined>
  /** Called with the next stuck state on every component-caused change. */
  onStuckChange?: (stuck: boolean) => void
}

// added to the composable's return value
stuck: Readonly<Ref<boolean>>
scrollToBottom: (options?: GhostScrollAreaScrollToBottomOptions) => void

Named ESM exports: GhostScrollArea, useGhostScrollArea, and the types above. Headless behavior lives in the composable; the SFC is a thin root that merges rootProps and the default slot.

Native attributes and listeners fall through to the single root (id, class, data-*, aria-labelledby, style, dir, etc.). The component owns class, data-part, data-orientation, data-type, data-overflow, data-stuck, overflow-related inline style, conditional tabindex, and when label is set on an active tab stop, role="region" with aria-label. Consumer onScroll, onWheel, onKeydown, onTouchstart, and onPointerdown listeners are merged with the component's stick-to-bottom listeners on the root, never replaced. The suspension-ending listeners (ST9) live on window only while a suspension is active. The component's listeners are passive where the event allows it and never call preventDefault or stop propagation.

Themed @ghostvue/themes GhostScrollArea must expose the same handle (element, scrollToBottom) and re-emit update:stuck, so the themed component, which the chat recipe uses, has the full surface.

Themed @ghostvue/themes GhostScrollArea wraps the unstyled component. Same behavioral props; no extra visual props. Importing it loads the default stylesheet and wraps the instance in .ghost-themed-scope.

v-model contracts ​

Overflow detection is internal state exposed via data-overflow for styling, not for v-model.

v-model:stuck (stuck / update:stuck) is the only model. It has meaning only while stickToBottom is effective. useControllableState owns the write path:

  • Controlled iff stuck is not undefined. Uncontrolled starts at true, so a freshly mounted log opens at its newest content.
  • The component writes the state when the reader releases it (ST5, ST6) or returns to the bottom (ST7), and when scrollToBottom() runs. Each write skips when Object.is(current, next), writes local state when uncontrolled, then emits update:stuck synchronously inside the DOM event or observer callback that caused it. Mount never emits.
  • A consumer write takes effect when the prop changes to a value that differs from the component's current state. Setting true scrolls to the bottom instantly, as scrollToBottom() does, and resumes following. Setting false stops following and leaves the scroll position where it is.
  • Echoes are bounded to the emit they acknowledge. When the component emits update:stuck(true) and the prop is not already true, it records one pending acknowledgement. The next prop change to true consumes it and does not scroll, so a parent echoing true after scrollToBottom({ behavior: 'smooth' }) does not cut the animation short. Any later emit or any other prop change clears the pending acknowledgement. A prop change that equals the component's current state does nothing. A consumer that ignored an earlier true, let the reader scroll up again, and later sets true gets the scroll, because the reader's release cleared the acknowledgement.
  • In controlled mode the prop is the truth. A consumer that ignores update:stuck(false) keeps the view following, so the reader's next scroll up is undone by the next content change. That is the consumer's choice (for example a kiosk log) and is documented, not prevented.
  • Turning stickToBottom off stops all following and removes data-stuck. Turning it back on resumes from the current stuck value; if that is true, the view scrolls to the bottom immediately.

Events, callbacks, slots, and exposed methods ​

  • Default slot: scrollable content. No nested viewport slot.
  • Events: update:stuck (boolean) for the model above. Native scroll listeners attach via fallthrough.
  • Exposed: element getter for the root HTMLElement, and scrollToBottom(options?: GhostScrollAreaScrollToBottomOptions): void. scrollToBottom scrolls the root to its maximum scrollTop. It works whether or not stickToBottom is set. With stickToBottom effective, it first sets stuck to true (emitting if that changes it), so following continues from there. The default behavior is 'auto' (instant). It is a no-op before mount and after unmount.

State model ​

Configuration props (orientation, type, as, label) are consumer-owned. Runtime state:

StateMeaning
data-overflownone when no enabled axis overflows; otherwise vertical, horizontal, or both.
Tab stopRoot receives tabindex="0" only when at least one enabled axis overflows and the subtree has no tabbable descendants (excluding the root). Otherwise tabindex is omitted. While the root itself has focus, the component does not remove tabindex, role, or aria-label; it applies a pending removal on blur.
data-stuckPresent only while stickToBottom is effective (true, and orientation is not horizontal): "true" while following, "false" after the reader releases it.

Overflow and focusable-content detection run after mount and on resize or slot text/content changes (ResizeObserver on the root and added element children; MutationObserver limited to childList and characterData with subtree, not attribute churn on the root). Server render omits tabindex and uses data-overflow="none".

Stick to bottom ​

These decisions define stickToBottom. "Distance" means scrollHeight − clientHeight − scrollTop on the root, and "at the bottom" means a distance of 2 CSS pixels or less. The 2px tolerance absorbs fractional scrollTop values under browser zoom; it is an internal constant, not API.

The component keeps a recorded position: the root's scrollTop, refreshed after every scroll write the component makes, in every observer callback (whether content grew or shrank), and in every scroll event. "Moved up" means a scroll event whose scrollTop is lower than the recorded position.

Every scroll write the component makes (mount, follow, instant return) uses scrollTo({ top, behavior: 'instant' }), so a consumer or theme scroll-behavior: smooth on the root never animates following.

  • ST1. Opt-in. Nothing changes unless stickToBottom is true and orientation is vertical or both. When it is not effective, the component adds no listeners, renders no data-stuck, and never emits update:stuck. scrollToBottom() still works.

  • ST2. State. stuck is the following state (v-model). data-stuck mirrors it. Overflow is not required: a short log that does not overflow stays stuck and starts following as soon as it does.

  • ST3. Engage on mount. When the component mounts with stuck true, it scrolls to the maximum in the mount hook, without waiting for an animation frame, so a client-rendered log never paints at the top. Under SSR the server HTML paints first at the top; the jump happens at hydration (see SSR and hydration).

  • ST4. Follow. While stuck and not held (ST5) or suspended (ST9), the component scrolls to the maximum whenever the content grows or the root's own height shrinks (a composer grows, a virtual keyboard opens). Two paths detect growth:

    1. Before paint. The existing ResizeObserver watches the root and its direct element children. When it reports a change, the follow step runs inside that callback, after layout and before paint, so no frame shows the content cut off.
    2. Backstop. The existing MutationObserver (childList and characterData on the subtree) always schedules a check for the next animation frame. If scrollHeight has grown since the last check, the follow step runs then. This covers growth no ResizeObserver entry reports: text placed directly in the root, a direct child with display: contents, or a direct child with a fixed height. Following on this path is one frame late. It is also the only path where ResizeObserver is missing.

    The docs recommend one direct element child that grows with the content (the chat recipe's <ol>) so following always takes the before-paint path. Following is always instant, never moves focus, and never changes the selection.

  • ST5. Release when the reader scrolls up. While stuck:

    1. Hold on intent. A wheel event on the root or a descendant with deltaY < 0 and no ctrlKey (Ctrl+wheel is zoom), or a keydown whose target is the root itself for ArrowUp, PageUp, Home, or Shift+Space, starts a hold when scrollTop > 0. A hold pauses following without changing stuck, so a content change that arrives before the browser scrolls cannot snap the reader back.
    2. Release on an upward scroll. A scroll event that moved up and leaves the distance above 2px sets stuck to false, with or without a hold. This covers wheel and key scrolling, scrollbar dragging, touch dragging, assistive-technology scrolling, find-in-page, and a consumer's own scrollIntoView of earlier content.
    3. Hold expiry. If no upward scroll arrives within two animation frames of the latest hold-starting event, the hold ends, stuck stays true, and a follow step runs. This is the outcome when the wheel scrolled a nested scroller (a code block) instead of the root, or a consumer handler cancelled the wheel.

    Keys on focused descendants are not inspected; their own scrolling is covered by item 2 and by ST6. The component never calls preventDefault on these events.

  • ST6. Keyboard focus is never scrolled away. While stuck, if a descendant of the root (not the root) has focus, matches :focus-visible, and a follow step would move it entirely out of the root's visible box, the component releases (stuck becomes false) instead of following, leaving scrollTop unchanged. A keyboard user on a link in an earlier message keeps it on screen. Focus from a pointer (a mouse click on "Copy") does not release; the pointer case is handled by ST9 while the button is pressed, and a mouse reader who keeps reading the stream keeps following it.

  • ST7. Re-engage at the bottom. A scroll event whose scrollTop differs from the recorded position and leaves the distance at 2px or less sets stuck to true, unless a hold (ST5) or suspension (ST9) is active. Events caused by the component's own writes match the recorded position and never re-engage. Reaching the bottom by wheel, End, a fling, or dragging the scrollbar resumes following.

  • ST8. Return on request. scrollToBottom() and a consumer write of stuck = true both set stuck to true and scroll to the maximum. With behavior: 'smooth' (only from scrollToBottom), the intermediate scroll events move down and never release. A content change during the animation follows instantly to the new bottom, which ends the animation. A wheel up during the animation starts a hold and then releases, as in ST5. In controlled mode, the parent echoing the value the component just emitted is not a consumer write and does not scroll (see v-model contracts), so a smooth return is not cut short.

  • ST9. Pointer and touch suspension. A primary pointerdown or a touchstart on the root or any descendant suspends following without changing stuck. This keeps content from moving under a pressed button (the click lands on what the user pressed) and from fighting a finger before the first scroll event. While suspended, an upward scroll still releases (ST5 item 2), but ST7 re-engagement waits. The suspension ends on pointerup or pointercancel for that pointer, or on touchend / touchcancel once no touches remain, listened for on window (added at suspension start, removed at its end), so releasing outside the root or on a node removed mid-press still ends it. Unmount also ends it. At the end:

    1. If the distance is 2px or less, stuck becomes true (emitting if it was false) and a follow step runs.
    2. Otherwise, if stuck is still true (the reader pressed or rested a finger without scrolling up while content arrived), a follow step runs and catches up.
    3. Otherwise the view stays released.
  • ST10. Shrinking content. When content shrinks and the browser clamps scrollTop, the observer callback that sees the shrink refreshes the recorded position to the clamped value. The clamp's scroll event then does not move up, and a clamp followed by growth in the same frame never reads as the reader scrolling up. Because that scroll event matches the recorded position, ST7 does not see it; instead the same observer callback re-engages: if the view is released, no hold or suspension is active, and the distance after the clamp is 2px or less, stuck becomes true (emitting) and later growth is followed.

  • ST11. No announcements, no focus moves. Following never moves focus, never adds a live region, and never changes role, tabindex, or the accessible name. Announcing new chat messages is the consumer's job; the chat specification gives the pattern.

  • ST12. Reduced motion. Following is already instant. scrollToBottom({ behavior: 'smooth' }) checks prefers-reduced-motion: reduce when called and scrolls instantly when it matches.

Loading, empty, disabled, read-only, and error states ​

None apply. Empty slot content is valid; overflow stays none. An empty stick-to-bottom log is stuck and follows its first content.

Async behavior ​

No async work beyond layout observation debounced to animation frames. The stick-to-bottom follow step (ST4) runs inside the ResizeObserver callback rather than a later frame. Release and re-engage run synchronously inside the DOM event that causes them, so the model and data-stuck never lag the reader's input by a frame.

Consumer data ​

The component does not accept data props and mutates no consumer-owned objects. It measures its own layout box and subtree focusability.

Accessibility contract ​

Semantics and relationships ​

Native scrolling on a div (or other host). When the root is a tab stop and label is set, the component assigns role="region" with aria-label so the name is valid under ARIA.

Focusable scroll container rules (axe scrollable-region-focusable):

  1. When content overflows on an enabled axis and there are no tabbable descendants, the root must be focusable (tabindex="0") and named (label / aria-label / aria-labelledby via fallthrough).
  2. When tabbable descendants exist, the root is not in the tab order; keyboard users scroll via focused descendants or pointer/trackpad.
  3. When nothing overflows, the root is not focusable even if empty.

Overflowing static text with no tab stops matches case (1) and is the primary DataTable-adjacent scenario for horizontal overflow.

Keyboard interaction ​

No component key handlers change scrolling. When the root is focused (tabindex="0") with overflow, the user agent scrolls the native overflow container (arrows, Page Up/Down, Home/End, Space, and equivalent assistive-technology scroll gestures). The component does not call preventDefault on keyboard events.

With stickToBottom, the component observes keys on the focused root only to release following before the native scroll (ST5):

Key on the focused rootNative resultStick-to-bottom effect
ArrowUp, PageUp, HomeScrolls upHolds, then releases on the scroll (ST5)
Shift+SpaceScrolls up a pageHolds, then releases on the scroll
ArrowDown, PageDown, SpaceScrolls downRe-engages if the scroll reaches the bottom
EndScrolls to bottomRe-engages (ST7)

Focus behavior ​

The root enters the tab order only per the table in State model. It does not trap or restore focus. Visible focus follows the platform outline on the scrollable root.

Assistive technology expectations ​

When focusable and named, the scrollable region is announced as a focusable element with its label; scrolling is performed after focus via keyboard or assistive-technology scroll gestures. When not focusable, assistive technology reads descendants normally.

Stick-to-bottom adds nothing to the accessibility tree. data-stuck is a styling hook, not state exposed to assistive technology. Screen-reader virtual cursors read the DOM in order regardless of scroll position, so following does not interrupt reading. A screen reader that scrolls the view to its reading position releases following through ST5 item 2, which keeps later content from pulling the view away.

Rendering and customization ​

Single root element with a default slot. Stable styling hooks:

  • class ghost-scroll-area
  • data-part="root"
  • data-orientation="vertical" | "horizontal" | "both"
  • data-type="auto" | "scroll"
  • data-overflow="none" | "vertical" | "horizontal" | "both"
  • data-stuck="true" | "false" (only while stickToBottom is effective)

Overflow axes use inline overflow-x / overflow-y from orientation and type. Consumers size the box (max-block-size, max-inline-size, flex child constraints, etc.) via attrs or parent layout.

Themed CSS under .ghost-theme / .ghost-themed-scope adds:

  • overscroll-behavior: contain on the root to reduce scroll chaining into the page
  • touch-friendly momentum scrolling where supported
  • scrollbar clearance from data-orientation: padding-inline-end for vertical, padding-block-end for horizontal, and both for both, each set to --ghost-space-inset-scrollbar. Overlay scrollbars ignore scrollbar-gutter and draw over the scrollport, so this padding keeps content out from under them. It is keyed on orientation rather than data-overflow, so it is present before content overflows and adds no layout shift. Classic scrollbars sit beside the padding. Logical properties keep it on the scrollbar side in RTL. Consumer padding on the root replaces it (the recipe is in a zero-specificity layer).
  • scrollbar-gutter: stable when data-type="scroll"
  • native scrollbar color tokens where the engine supports scrollbar-color
  • scroll-behavior: auto under prefers-reduced-motion: reduce

Token use is limited to semantic tokens: --ghost-border-strong for the scrollbar thumb and --ghost-space-inset-scrollbar for clearance. The clearance token is a semantic space.inset token (16px, the same at every density because platform scrollbars do not scale with density), not a component token; any scroll container may use it.

Environment behavior ​

SSR and hydration ​

Initial markup uses configuration props and data-overflow="none". Overflow measurement and tabindex assignment run only in the browser after mount, avoiding hydration mismatches. An integration test uses expectSsrHydration.

With stickToBottom, the server renders data-stuck from the initial state ("true" when uncontrolled), so hydration matches. The server cannot set a scroll position, so server-rendered HTML first paints at the top of the content and jumps to the bottom when the component mounts during hydration (ST3). Apps that cannot accept that jump render the log on the client only. The docs say so. A CSS-only bottom start (flex-direction: column-reverse) is out of scope because it reverses the order that keyboard and assistive technology see unless the DOM is reversed too.

Mobile and touch ​

Native touch scrolling on the root. No custom touch handlers. The themed recipe may set -webkit-overflow-scrolling: touch. Minimum target size is not imposed on the root; focusable children keep their own sizes.

With stickToBottom, a passive touchstart listener on the root and touchend / touchcancel listeners on window only suspend following while a finger is down (ST9); they never change scrolling. When a virtual keyboard opens and the layout shrinks the root, ST4 keeps a stuck view at the bottom. iOS momentum scrolling that overshoots the bottom and bounces back leaves the distance at 0 and does not release.

Performance ​

ResizeObserver (when available) watches the root; overflow checks are coalesced with requestAnimationFrame. No virtualization. Expected scale is modest DOM subtrees (hundreds of nodes), not million-row tables.

Stick-to-bottom reuses the same observers. A follow step reads scrollHeight and clientHeight once and writes scrollTop once per observer callback, so a stream that appends text every few milliseconds costs one layout read and one write per frame. The backstop check (ST4 item 2) is one scrollHeight read per frame in which a mutation happened, coalesced with the existing overflow measurement frame. Listeners are passive where the event allows it and are removed on unmount; window listeners exist only during a pointer or touch suspension. A log of a few thousand messages is the expected ceiling; longer histories need virtualization, which stays out of scope.

Composition ​

useGhostScrollArea owns orientation/type styles, overflow measurement, tabindex policy, stick-to-bottom state and listeners, and data-* hooks. GhostScrollArea binds the composable to a template ref and slot. Themed wrapper adds scoped stylesheet load only and forwards stickToBottom, v-model:stuck, and scrollToBottom().

Stick-to-bottom stays inside useGhostScrollArea rather than a separate useGhostStickToBottom composable: it needs the same observers, the same root element, and the same overflow measurement. A separate export can follow additively if a non-ScrollArea scroller needs it. useControllableState owns the stuck model, as it does for other GhostVue models.

Manifests: packages/vue/manifests/ghost-scroll-area.manifest.json and packages/themes/manifests/ghost-scroll-area.manifest.json.

Test plan ​

  • Vue tests: default hooks, orientation/type overflow styles, data-overflow updates when layout overflows (stubbed metrics), tabindex when overflow without tabbables, no tabindex with tabbable children, label → aria-label when region role when labeled tab stop, no key interception, attribute fallthrough, SSR HTML without tabindex.
  • Composable tests: overflow axis matrix, focusable-descendant detection, tabindex and aria-label policy.
  • Integration: expectSsrHydration with slotted static content.
  • Browser: playground scenarios (vertical list, horizontal strip, themed bounded region), axe scan without scrollable-region-focusable violations.
  • Browser: themed scrollbar clearance. For each orientation in LTR and RTL, the themed root's computed padding on the scrollbar edges equals --ghost-space-inset-scrollbar, the content box ends at least that far from the scrollbar edge of the scrollport, and the docs examples' last timestamp and tile borders stay clear of the scrollbar region.
  • Visual baselines: registered examples via pnpm test:visual:docker.
  • No compile-time consumer fixtures: closed unions only.

Stick-to-bottom additions:

  • Composable tests (stubbed metrics and events): ST1 no listeners, no data-stuck, and no emit when off or horizontal (with the one-time dev warning); mount scroll without emit (ST3); follow on content growth and on root shrink (ST4 item 1); backstop follow for text placed directly in the root and for a display: contents child (ST4 item 2); a hold from wheel up and from each ST5 key on the root, released only by an upward scroll; hold expiry when no upward scroll follows (nested scroller, cancelled wheel) leaves stuck true; Ctrl+wheel starts no hold; a queued scroll from the component's own write after a hold neither releases nor re-engages (no false, true, false sequence); no release from keys on a descendant or from a scroll that moves down; shrink then grow within one frame does not release (ST10); ST6 release for a :focus-visible descendant and no release for pointer focus; re-engage at 2px (ST7); scrollToBottom sets and emits stuck only on change; controlled stuck true and false writes; a controlled consumer that ignores an emitted true, lets the reader release, and later writes true gets an immediate scroll; a released view clamped to the bottom by shrinking content re-engages from the observer callback and follows the next growth (ST10); a controlled echo after a smooth scrollToBottom does not cut it short (ST8); ST9 suspension ends from windowpointerup outside the root, from touchend on a removed target, and on unmount, with each of the three end outcomes; reduced-motion downgrade (ST12); all writes use behavior: 'instant'; listener cleanup on unmount; consumer onScroll / onWheel / onKeydown still called.
  • Tab-stop tests: a focused root keeps tabindex, role, and aria-label when tabbable content arrives, and drops them on blur.
  • Vue tests: v-model:stuck round trip, data-stuck values, exposed scrollToBottom, SSR markup with data-stuck="true" and no scroll position, each through both the headless and the themed GhostScrollArea (v-model:stuck, scrollToBottom(), and element reachable from the themed component).
  • Integration: expectSsrHydration with stickToBottom and slotted content.
  • Browser (Playwright, real layout): a streaming fixture appends text every 50ms. Assert the last line stays visible while stuck; a mouse wheel up releases and the position holds across later chunks; End on the focused root re-engages; scrollToBottom() returns and resumes; a keyboard-focused button in an earlier message stays visible while chunks arrive (ST6); a mouse click on a button in a moving message lands on that button (ST9); a touch drag up releases and a drag back to the bottom re-engages on lift (ST9); a wheel over a nested scrollable block leaves following on (ST5 item 3); a root with scroll-behavior: smooth still follows instantly. Run once with reducedMotion: 'reduce'.
  • Axe scan of the streaming fixture with following on and off.

Documentation plan ​

docs/components/scroll-area.md with API reference, vertical, horizontal, composable, themed, and accessibility sections; playground gallery section; roadmap status update.

The stick-to-bottom amendment adds a "Stick to bottom" section with a streaming log example (examples/scroll-area/stick-to-bottom.vue) that shows v-model:stuck driving a "Jump to latest" button, the SSR first-paint note, and a link to the chat page for the full chat recipe. The playground gains a streaming log exercise.

Compatibility and release impact ​

Additive; minor Changesets for @ghostvue/vue and @ghostvue/themes.

The stick-to-bottom amendment is additive and opt-in: stickToBottom defaults to false, and an instance without it renders the same markup and attaches the same listeners as before. It ships with minor Changesets for @ghostvue/vue and @ghostvue/themes. New public contracts: the stickToBottom and stuck props, update:stuck, scrollToBottom(), the three composable options, data-stuck, and the 2px bottom tolerance as observable behavior.

Keeping a focused root's tabindex, role, and aria-label until blur fixes focus dropping to the document when tabbable content arrives. It applies with or without stickToBottom and is a patch-level behavior fix in the same Changeset.

Open architectural questions ​

None blocking.

  • GHO-38 styling hooks. Uses existing data-part / data-* attributes only.
  • Custom scrollbars. Out of scope; native-first per issue.