Skip to content
navius

Slider

An input where the user selects a value from within a given range.

60

Features

  • Can be controlled (@bind-Value) or uncontrolled (DefaultValue).
  • Supports multiple thumbs: add more than one NaviusSliderThumb for a range.
  • Supports a custom Step, Min/Max and MinStepsBetweenThumbs.
  • Horizontal or vertical orientation, with optional Inverted direction and RTL support.
  • Full keyboard navigation; the thumb is role="slider" with the correct aria-value* state.
  • Renders a hidden number input per thumb (when Name is set) for native form submission.

Installation

Reference the Navius.Primitives package for the headless primitive, or vendor a styled version with the CLI: navius add copies the styled zits/ui component plus the brain files it depends on.

Anatomy

Import the parts and assemble them.

API Reference

Contains all the parts of a slider. Owns the value array and cascades it to the parts. Renders a span.

Prop Type Default
Value IReadOnlyList<double>? -
ValueChanged EventCallback<IReadOnlyList<double>> -
DefaultValue IReadOnlyList<double>? -
ValueCommitted EventCallback<IReadOnlyList<double>> -
Min double 0
Max double 100
Step double 1
MinStepsBetweenThumbs int 0
LargeStep double 0
Orientation string "horizontal"
Inverted bool false
Dir string? -
Disabled bool false
Name string? -
Form string? -
ChildContent RenderFragment? -
Data attribute Values
[data-orientation] "horizontal" | "vertical"
[data-disabled] Present when disabled

The rail the range fills and the thumb travels along. Renders a span.

Prop Type Default
ChildContent RenderFragment? -
Data attribute Values
[data-orientation] "horizontal" | "vertical"
[data-disabled] Present when disabled

The filled portion of the track between the lowest and highest thumb. Renders a span (absolutely positioned).

Prop Type Default
- - -
Data attribute Values
[data-orientation] "horizontal" | "vertical"
[data-disabled] Present when disabled

A draggable handle and the accessibility surface (role=slider). Add one per value. Renders a span (absolutely positioned).

Prop Type Default
ChildContent RenderFragment? -
Data attribute Values
[data-orientation] "horizontal" | "vertical"
[data-disabled] Present when disabled

Accessibility

Implements the slider WAI-ARIA APG pattern: each thumb exposes aria-valuemin, aria-valuemax, aria-valuenow and aria-orientation; the bounds narrow to the neighbouring thumbs on a multi-thumb slider. Behavior is covered by the browser test suite and an axe-core WCAG gate in CI.

When the slider has no visible label, give each NaviusSliderThumb an aria-label (or aria-labelledby) so assistive technology can announce what it controls.

Key Description
ArrowRight Increments the value by Step (flips under RTL / Inverted).
ArrowLeft Decrements the value by Step (flips under RTL / Inverted).
ArrowUp Increments the value by Step.
ArrowDown Decrements the value by Step.
Shift + Arrow Increments / decrements by the large step.
PageUp Increments the value by the large step.
PageDown Decrements the value by the large step.
Home Sets the value to Min.
End Sets the value to Max.