On this page
@addTagHelper *, Webority.Ui.RazorSingle thumb
Use one thumb to pick a single number, and showValue to show it beside the track.
Range mode
Use two thumbs for a span such as a price band, each thumb stopping at the other.
Showing the value
Show the number with a unit, so people read the value without guessing its scale.
Sizes
Match the slider size to the form around it, using sm in dense panels.
Step
Set step to the smallest change that matters, so each key press and drag moves a sensible amount.
Error and helper text
Explain the limit under the slider, and show the error when the value breaks it.
Disabled
Disable a slider whose setting is locked, and say why beside it.
Form submission
The slider creates a hidden form mirror input. Single-thumb submits under name; range mode submits start under start-name and end under end-name.
Every option
Every value of every prop, one cell each.
mode: single vs range
(default) single-thumbrange, dual-thumbvalue, start and end
value="0"value="100"range start="0" end="100"bounds & step
(default) min="0" max="100" step="1"step="10"min="50" max="150"range min="50" max="150" step="5"label
label="Volume"state
(default)requireddisablederror + helper text (helper text hidden)helper text onlydisabled + rangereadOnly
(default), no read-onlyread-onlyloading
(default), no loadingloadingoptional and optionalLabel
(default), no optionaloptionaloptional optional-label="Facultatif"help and helpLabel
(default), no helphelp="Drag a thumb, or use the arrow keys."help with help-label="About this slider"name
name="volume" (form field name, no visible change)startName and endName
start-name="min" end-name="max" (range, no visible change)defaultValue, defaultStart and defaultEnd
value="30" (React: defaultValue={30})start="20" end="80" (React: defaultStart and defaultEnd)size: every size
size="sm"size="md" (default)size="lg"showValue & unit
(default), no show-valueshow-value="true"show-value="true" unit="%"range show-value="true" unit="$"grouping: lakh and crore groups
grouping="Indian" show-value="true"grouping="None" (default)id
id="opt-id" (no visible change)ariaLabel
aria-label="Volume level" (no visible label, sets the accessible name)className
input-class="mb-0" (no visible change)fieldClassName
class="mb-0" (wrapper, no visible change)onChange
onChange: React only (Razor posts the value with the form)ref
id="opt-ref" (React: ref, reached by id)asp-for
asp-for="Volume" (binds name, id, value, label and required)Guidance
What to do, and what to avoid.
Use it when
- Pick a single numeric value visually (volume, brightness, rating)
- Select a range (price range, budget, date window)
- Compare multiple values on a continuous scale
- When keyboard input is secondary to visual feedback
Reach for something else when
- Precise multi-digit values. → AppNumberInput
- Categorical choices. → AppSelect, AppRadio, or AppSegmented
- Boolean on/off. → AppSwitch
- When the scale is unclear (add labels or a reference)
Reference
Try every prop, read the full list, and check keyboard and screen reader behaviour.
27 props. The 5 most used come first.
Used on most screens 5 props
| Prop | Type | Default | Description |
|---|---|---|---|
| valuedefault 50 | string | 50 | Current value (single mode). |
| mindefault 0 | decimal | 0 | Lowest value the slider can take. |
| maxdefault 100 | decimal | 100 | Highest value the slider can take. |
| stepdefault 1 | decimal | 1 | Distance between two allowed values. |
| rangedefault false | bool | false | Enables dual-thumb range mode. |
Less common 22 props
| Prop | Type | Default | Description |
|---|---|---|---|
| labeldefault - | string | - | Visible label above the control. |
| namedefault - | string | - | Form field name (single mode). |
| startdefault 25 | string | 25 | Range start (range mode). |
| enddefault 75 | string | 75 | Range end (range mode). |
| start-namedefault - | string | - | Form field name for range start. |
| end-namedefault - | string | - | Form field name for range end. |
| requireddefault false | bool | false | Marks the field as required. |
| optionaldefault false | bool | false | Ends the label with (optional) when the field is not required. Required wins when both are set. |
| optional-labeldefault (optional) | string | (optional) | Replaces the built-in English text, for other languages. |
| helper-textdefault - | string | - | Helper text under the control. |
| errordefault - | string | - | Error text under the control; sets aria-invalid. |
| sizedefault - | sm | md | lg | - | Control size tier. |
| disableddefault false | bool | false | Disables the control. |
| show-valuedefault false | bool | false | Shows a label with the current value or values. |
| unitdefault - | string | - | Suffix for the value label, for example %. |
| groupingdefault none | none | indian | none | Digit grouping of the value label: indian writes 1,50,000; none writes 150000. |
| asp-fordefault - | ModelExpression | - | Razor-only. Binds name, id, value, label and required from a model property; explicit attributes still win. |
| read-onlydefault false | bool | false | Shows the value but blocks editing. The value still posts. |
| loadingdefault false | bool | false | Shows a busy state and blocks input while data loads. |
| helpdefault - | string | - | Info-tip content shown beside the label. |
| help-labeldefault More information | string | More information | The accessible name of the info-tip button. |
| input-classdefault - | string | - | Extra classes on the control itself (the slider element). A plain class attribute merges onto the wrapper instead. |
Screen reader
3 notes- The visible label is tied to the control by id, and the control takes its accessible name from a text label or from ariaLabel.
- aria-describedby points at the error text, or at the helper text when there is no error, and an error also sets aria-invalid.
- A required slider shows a required mark beside its label and carries the required attribute.