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

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 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

Adheres to the slider WAI-ARIA design 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.

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.