RizzyUI

Slider

RzSlider provides single-value and range selection with shadcn-style slider anatomy: root, track, range, and thumbs. It renders initial value state on the server, uses Alpine for drag/click/keyboard behavior, and posts values through hidden inputs for SSR form workflows.

Basic Usage

Single-thumb slider for selecting one value.

Source
<RzSlider Name="Volume" DefaultValue="
" Min="0" Max="100" Step="1" />

Range Slider

Two-thumb slider with minimum spacing.

Source
<RzSlider Name="Price" DefaultValue="
" Min="0" Max="100" Step="1" MinStepsBetweenThumbs="5" />

Vertical Orientation

Vertical slider variant for narrow layouts.

Source
<RzSlider Name="Gain" DefaultValue="
" Orientation="SliderOrientation.Vertical" Min="0" Max="100" />

Disabled State

Render a non-interactive slider for read-only scenarios.

Source
<RzSlider Name="ReadOnly" DefaultValue="
" Disabled="true" />

Form Post Example

Hidden inputs are emitted using indexed names for model binding compatibility.

Source
<form method="post" action="/components/slider">
    <RzSlider Name="PriceRange" DefaultValue="
" UseIndexedNames="true" />
    <RzButton Type="ButtonType.Submit" class="mt-4">Submit</RzButton>
</form>

Parameters

ParameterTypeDescription
Valuedouble[]?Server-provided current values.
DefaultValuedouble[]?Fallback initial values when Value is null.
MindoubleMinimum allowed slider value.
MaxdoubleMaximum allowed slider value.
StepdoubleValue increment used for snapping.
OrientationSliderOrientationHorizontal or vertical layout.
DisabledboolDisables pointer and keyboard interactions.
InvertedboolInverts value-to-position mapping.
MinStepsBetweenThumbsdoubleMinimum distance between adjacent thumbs.
Namestring?Base name for hidden form inputs.
UseIndexedNamesboolUse names like Name[0], Name[1].
AriaLabelstring?Default single-thumb label.
AriaLabelsstring[]?Per-thumb labels for range mode.
AriaLabelledBystring?ID reference for visible external label.
AriaDescribedBystring?ID reference for external helper text.
ComponentAssetKeysstring[]Logical asset keys resolved via RizzyUIConfig.

Alpine API

RzSlider uses an internal Alpine API for pointer and keyboard behavior; no public client API is intended for direct consumption.