navius

Scroll Area

Augments native scroll functionality for custom, cross-browser styling.

v1.2.0-beta.1
v1.2.0-beta.0
v1.1.5
v1.1.4
v1.1.3
v1.1.2
v1.1.1
v1.1.0
v1.0.9
v1.0.8
v1.0.7
v1.0.6
v1.0.5
v1.0.4
v1.0.3
v1.0.2
v1.0.1
v1.0.0
v0.9.0
v0.8.0

Features

  • Scrolling stays native, so keyboard, wheel, touch, and trackpad all work for free.
  • Fully styleable custom scrollbar and thumb that sit consistently across browsers and platforms.
  • Supports both vertical and horizontal axes, with a corner where they meet.
  • Four visibility modes via Type: auto, always, hover, and scroll.
  • Right-to-left aware via Dir or a cascaded direction provider.

Installation

Install the brain, or copy just this primitive in with the CLI.

Anatomy

Import the parts and assemble them.

API Reference

Contains all the parts of a scroll area. Owns the shared context and renders a div.

Prop Type Default
Type string "hover"
Orientation string "vertical"
ScrollHideDelay int 600
Dir string? -
ChildContent RenderFragment? -
Data attribute Values
[data-navius-scrollarea] Present on the root
[data-orientation] "vertical" | "horizontal"
[data-type] "auto" | "always" | "hover" | "scroll"

The viewport area of the scroll area. This is the native overflow container; give it overflow and a bounded size. Renders a div.

Prop Type Default
ChildContent RenderFragment? -
Data attribute Values
[data-navius-scrollarea-viewport] Present on the viewport
[data-navius-scrollarea-content] Present on the inner content wrapper

The vertical or horizontal scrollbar track for one axis. Renders a div.

Prop Type Default
Orientation string "vertical"
ForceMount bool false
ChildContent RenderFragment? -
Data attribute Values
[data-navius-scrollarea-scrollbar] Present on the scrollbar
[data-orientation] "vertical" | "horizontal"
[data-hovering] Present while hovering the scroll area
[data-scrolling] Present while actively scrolling

The draggable handle inside a scrollbar; sizes and positions itself from scroll metrics. Renders a div.

Prop Type Default
…attributes IDictionary<string, object>? -
Data attribute Values
[data-navius-scrollarea-thumb] Present on the thumb
[data-orientation] "vertical" | "horizontal"
[data-scrolling] Present while actively scrolling

The square where the vertical and horizontal scrollbars meet. Renders only when both axes overflow. Renders a div.

Prop Type Default
…attributes IDictionary<string, object>? -
Data attribute Values
[data-navius-scrollarea-corner] Present when both axes overflow

Accessibility

Scrolling stays native: the Viewport is a real overflow: auto element, so all the platform's keyboard, wheel, touch, and trackpad scrolling (and the browser's own scroll a11y semantics) work unchanged. The custom scrollbar is a presentational div with no role="scrollbar", deliberately, so it adds no redundant noise for assistive technology.

When the Viewport (or a focusable child) is focused, the standard browser scroll keys apply: Arrow keys, Page Up / Page Down, and Home / End. Navius does not intercept these.