Skip to content

Slider

Slider renders NaviusSlider (value array, track/range/thumb, keyboard + drag) with one NaviusSliderThumb emitted per entry in the value array. Value is forwarded to the primitive only when the consumer sets it to a non-null list, so the uncontrolled DefaultValue path stays live.

Terminal window
navius add slider --to ./src/MyApp --namespace MyApp.Ui
@using Zits.Ui.Components
<ZitsSlider @bind-Value="_volume" Max="100" Step="1" />
@code {
private IReadOnlyList<double> _volume = new double[] { 50 };
}

ValueChanged, DefaultValue, ValueCommitted, Min, Max, Step, MinStepsBetweenThumbs, Orientation, Inverted, Dir, Disabled, Name, and Form are the primitive’s own props and pass through unchanged. The styled root adds:

Prop Type Default Description
Value / ValueChanged IReadOnlyList<double>? null Controlled values, one per thumb. Bind with @bind-Value. A null value is treated as uncontrolled.
ThumbLabel string? null Accessible name applied to each thumb (needed since there is no visible label). Multi-thumb sliders get "{ThumbLabel} N" per thumb.

Attributes on ZitsSlider merges with the root base class via Cn.Merge and forwards to NaviusSlider. Track, range, and thumb classes are fixed (not overridable per instance).

Part Attribute Description
Root, Track, Range, Thumb data-orientation horizontal/vertical, emitted by the composed primitive; drives the axis-dependent layout classes.
Root, Thumb data-disabled Present when Disabled is true, emitted by the composed primitive; drives the disabled opacity/pointer-events styling.