<kern-range>
Slider for brightness, volume or thresholds, form-associated. One handle (value is a number) or two with range (value is "from/to", the handles cannot cross). Drag or click the track; keyboard: Arrow keys ± step, Page Up/Down ± a tenth of the range, Home/End to the limits. marks adds labelled ticks.
Examples
Slider
Drag or click the track. Keyboard: arrow keys ± step, Page Up/Down ± a tenth of the range, Home/End to the limits. marks adds labelled ticks; the current value with unit is shown next to the label.
Two handles
With range, value is "from/to" and the handles cannot cross. label-from and label-to name the handles for screen readers.
Properties
ariaLabelTextstring | undefined
Accessible name when there is no visible label.
disabledboolean
errorstring | undefined
hintstring | undefined
labelstring | undefined
labelFromstring | undefined
labelTostring | undefined
localestring | undefined
BCP 47 locale for numbers; defaults to <html lang>, then the browser language.
marksnumber[] | string
Ticks with labels, e.g. 0,25,50,75,100.
maxnumber
minnumber
namestring | undefined
rangeboolean
Two handles; value becomes "from/to".
showValueboolean
Show the current value next to the label.
stepnumber
unitstring | undefined
Unit after the shown value, e.g. „%“.
valuenumber | string
A number, or "from/to" with range.
Events
kernChangeCustomEvent<{ value: string | number; }>
When a drag ends or a key changed the value.
kernInputCustomEvent<{ value: string | number; }>
While dragging or on every key step.
Methods
setFocus()setFocus() => Promise<void>
Focuses the (first) handle.
CSS parts
thumbEach handle
trackThe track