AppSlider
Single-thumb and dual-thumb slider — the visual way to pick a value or range.
<app-slider label="Volume" name="volume" value="50" />A slider lets users pick a single value or a range by dragging a thumb (or clicking the track). It supports keyboard navigation (arrow keys, Page Up/Down, Home/End), form submission, and optional value display. Use range mode for two-value ranges (price, date range, filter bounds).
It renders the shared <wui-slider> control and takes its look entirely from @webority/theme, so the Razor <app-slider> and the React <AppSlider> render identical sliders on every Webority surface.
Playground
Every meaningful attribute, live. Each change re-renders the real tag helper on the server, so the markup underneath is the exact call that produced the slider above it.
Basic (single-thumb)
A single-thumb slider captures one value. The label, hint, and error attributes wrap it in the standard .field shell and wire accessibility attributes.
show-value attribute to display it next to the slider.Show code
<app-slider label="Volume" name="volume" value="50" />
The slider is form-associated — the value posts under name when the form submits. It also dispatches a native change event you can listen for.
Dual-thumb range mode
Set the range attribute to enable two thumbs. Pass start and end instead of value; they post under start-name and end-name. Thumbs cannot cross.
Show code
<app-slider range="true" label="Price range" start="20" end="80" start-name="min_price" end-name="max_price" show-value="true" unit="$" />
Showing the value
Set show-value to display the current value(s) next to the slider. The optional unit attribute adds a suffix (e.g., %, $, km).
Show code
<app-slider label="Discount" name="discount" value="75" show-value="true" unit="%" min="0" max="100" />
Size variants
The size attribute controls the height: sm (28px), default (32px), or lg (36px). The thumb, track, and text all scale together.
Show code
<app-slider label="Small (sm)" name="v1" value="50" size="sm" /> <app-slider label="Medium (default)" name="v2" value="50" /> <app-slider label="Large (lg)" name="v3" value="50" size="lg" />
Step & keyboard
min and max set the range (0–100 by default). step controls the increment for keyboard navigation and dragging (1 by default).
Show code
<app-slider label="Increment (step=10)" name="increment" value="50" min="0" max="100" step="10" show-value="true" />
When a thumb is focused:
- ← → — decrement/increment by
step - Page Down Page Up — decrement/increment by 10×
step - Home End — jump to
min/max
You can also click anywhere on the track to move the nearest thumb to that position.
Error & hint
The error attribute marks the field invalid (sets aria-invalid="true", renders an error message below). The hint attribute shows helper text (hidden when error is present).
Show code
<app-slider label="Minimum requirement" name="minimum" value="30" error="Value too low" hint="Must be at least 50" show-value="true" />
Disabled state
Set disabled="true" to prevent interaction and mute the visuals. The control still posts an empty value in forms.
Show code
<app-slider label="Locked setting" name="locked" value="50" disabled="true" show-value="true" />
When to use
Use when:
- Picking a single numeric value visually (volume, brightness, rating, discount %)
- Selecting a range (price range, budget, date window, filter bounds)
- Comparing multiple values on a continuous scale
- Keyboard input is secondary to visual feedback
Don't use when:
- Precise multi-digit values are needed — use
<app-number-input> - Choosing from categorical options — use
<app-select>,<app-radio>, or<app-segmented> - Toggling a boolean — use
<app-switch> - The scale is unclear or lacks reference points — add labels, legends, or example values first
Every option
The whole surface of the component, one cell per value — mode, bounds, step, unit, and the states a normal example never shows together.
<wui-slider> implementation has no marks/ticks attribute — it renders a plain track and thumb(s) only. A caller wanting labeled steps composes its own scale markup below the slider (see the Step & keyboard example above).mode — single vs range
(default) single-thumbrange — dual-thumbsize — every size
size="sm"
size="md"
size="lg"
state
(default)requireddisablederror + hint (hint hidden)hint onlydisabled + rangeshow-value & unit
(no show-value)show-value="true"show-value="true" unit="%"range show-value="true" unit="$"bounds & step
(default) min="0" max="100" step="1"step="10"min="50" max="150"range min="50" max="150" step="5"Attributes
| Attribute | Type | Default | Description |
|---|---|---|---|
| label | string | — | Field label above the control. |
| name | string | — | Form field name for single-thumb mode; omit in range mode. |
| value | string | 50 | Current value (single-thumb mode only). Omit in range mode; use start/end instead. |
| start | string | 25 | Range start (range mode only). Used with end and start-name. |
| end | string | 75 | Range end (range mode only). Used with start and end-name. |
| start-name | string | — | Form field name for range start (range mode only). |
| end-name | string | — | Form field name for range end (range mode only). |
| min | decimal | 0 | Minimum value. |
| max | decimal | 100 | Maximum value. |
| step | decimal | 1 | Increment step for keyboard navigation and dragging. |
| required | bool | false | Renders the required asterisk on the label. |
| hint | string | — | Helper text below the control (hidden when error is present). |
| error | string | — | Validation message; replaces the hint and marks the field invalid. |
| size | string | — | Control height tier: sm / lg. Omit for the default (md). |
| disabled | bool | false | Disables the field. |
| show-value | bool | false | Displays the current value(s) next to the slider. |
| unit | string | — | Suffix for the value label (e.g., %, $, km). Only used if show-value="true". |
| range | bool | false | Enables dual-thumb range mode. Use start/end instead of value. |
| asp-for | ModelExpression | — | Razor-only. Binds name, id, value, label and required from a model property; explicit attributes still win. |
| input-class | string | — | Extra classes on the control itself (the wui-slider) — the React className counterpart. The plain class attribute merges onto the .field wrapper instead. |
Form submission
The slider creates hidden form mirror input(s) for posting values to the server:
- Single-thumb mode: posts the value under
name - Range mode: posts start under
start-nameand end underend-name
The slider always participates in form submission and respects form reset (restores the initial value/range).