Scrolling happens natively on ScrollAreaViewport — the native scrollbar is hidden with CSS, and ScrollAreaScrollbar/ScrollAreaThumb render an ARIA-described overlay driven by the real scroll metrics. The overlay is also interactive: clicking the track jumps to that position, and the thumb can be dragged, both calling back into ScrollArea to scroll the viewport.
When scrollbars are visible. This is exposed as data-type for CSS to act on — "hidden" is expected to hide the custom scrollbar entirely via CSS while the viewport still scrolls natively.
class
string
—
CSS class
id
string
—
HTML id
children
Children
—
Content — typically a ScrollAreaViewport and one or more ScrollAreaScrollbar
scrollTo(position: { top?: number; left?: number })
Imperatively scrolls the viewport to the given position, clamped to the valid scroll range. Used internally by ScrollAreaScrollbar (track click) and ScrollAreaThumb (drag), but can be called directly too
_onScroll(el: HTMLElement)
Internal — called by ScrollAreaViewport on mount and on every scroll event to update tracked metrics
_registerViewport(el: HTMLElement | null)
Internal — called by ScrollAreaViewport on mount/unmount to register (or clear) the viewport element used by scrollTo
The ScrollArea state instance — used to size/position the thumb proportionally to the visible fraction of content. Optional — sizing math no-ops without it.
orientation
"vertical" | "horizontal"
"vertical"
Which scroll axis to size/position against
class
string
—
CSS class
id
string
—
HTML id
children
Children
—
Accepted by the prop type but not rendered — ScrollAreaThumb has no content slot
ScrollAreaThumb doesn't read data-* attributes for sizing — it sets the CSS custom properties --morphos-thumb-size and --morphos-thumb-offset directly on its own inline style, computed from the tracked scroll metrics.