inputshwcz-input-range

Range Slider

Custom slider with a draggable knob, filled track, optional value label, and a two-knob range mode.

Attributes

AttributeTypeDefaultDescription
multiplebooleanfalseEnables two knobs (low/high) selecting a range; the value submits as two entries.
minnumber0Minimum value (default 0).
maxnumber100Maximum value (default 100).
stepnumber1Step increment (default 1).
labelstring | booleanfalseShows a value label following the knob.
label-position'top' | 'bottom''top'Label placement relative to the track: top (default) or bottom.
aria-labelstring''Accessible label of the slider group (defaults to the aria-label i18n text).
Inherited from InputMixin
AttributeTypeDefaultDescription
disabledbooleanfalseDisables the control so it cannot be interacted with.
formstring''Associates the hidden form input with a form by id, even when the component sits outside that form.
namestring''Field name for the hidden form input; array values submit as name[].
placeholderstring''Placeholder text for the control's empty state.
requiredbooleanfalseMarks the control as required.
valuestring''Initial value of the control, synchronized with the hidden form input.
Inherited from Hwc
AttributeTypeDefaultDescription
i18nstring''Per-instance text overrides as key: text pairs, merged over the global z-i18n script and the built-in defaults.
floatingstring''Floating UI placement options (for example offset and shiftPadding) parsed as key: value pairs.
force-prevent-rerenderbooleanfalseSkips re-rendering after the first render; an existing data-host-inner child is adopted as the rendered DOM.
templatestring''Selector or id of an external element or <template> whose inner content is cloned in place of an inline template[data-fn="template"] child.
Inherited from Base
AttributeTypeDefaultDescription
clsstring''Adds classes to named parts as key: classes pairs; a plain string targets the default part.
stlstring''Adds inline styles to named parts as key: styles pairs; a plain string targets the default part.

Custom Styling (cls / stl)

Default cls target:host-inner · defaultstl target:host-inner

KeyDefault classclsstlDescription
fill—yesnoThe filled portion of the track.
host-innerz-input-rangeyesyesThe slider root (default z-input-range); the default cls/stl target.
knob—yesnoThe draggable knob.
knob-dragging—yesnoClass applied to the knob while dragging.
label—yesyesThe value label.
label-bottom—yesnoClass positioning the label below the track.
label-top—yesnoClass positioning the label above the track.
runnable—yesyesThe clickable/draggable track area.

CSS Variables

VariableDefaultScopeDescription
--z-input-range-fill-bgvar(--z-primary).z-input-range-fillFill base color, mixed with transparency using --z-input-range-fill-bg-o.
--z-input-range-fill-bg-o100%.z-input-range-fillFill opacity percentage used in the color mix.
--z-input-range-knob-bgvar(--z-bg).z-input-range-knobKnob base color, mixed with transparency using --z-input-range-knob-bg-o.
--z-input-range-knob-bg-o100%.z-input-range-knobKnob opacity percentage used in the color mix.
--z-input-range-knob-border-colorvar(--z-primary).z-input-range-knobKnob border base color, mixed with transparency using --z-input-range-knob-border-color-o.
--z-input-range-knob-border-color-o50%.z-input-range-knobKnob border opacity percentage used in the mix.
--z-input-range-knob-radius9999px.z-input-range-knobCorner radius of the knob.
--z-input-range-knob-shadowvar(--z-global-shadow).z-input-range-knobBox shadow of the knob.
--z-input-range-knob-size1rem.z-input-range-knobDiameter of the knob.
--z-input-range-label-offset-y2.5rem.z-input-rangeVertical offset of the value label from the track.
--z-input-range-track-bgvar(--z-primary).z-input-range-runnableTrack base color, mixed with transparency using --z-input-range-track-bg-o.
--z-input-range-track-bg-o20%.z-input-range-runnableTrack opacity percentage used in the color mix.
--z-input-range-track-height0.375rem.z-input-rangeHeight of the track.
--z-input-range-track-radiusvar(--z-global-radius).z-input-rangeCorner radius of the track.

i18n Keys

KeyDefaultPlaceholdersDescription
aria-labelRange slider—Default accessible label of the slider group. Used in: host-inner.
aria-range-textRange from {low} to {high}low, highRange value text template with {low} and {high}.
aria-value-textValue: {value}valueSingle-knob value text template with {value}.
high-knob-labelMaximum value—Accessible label of the high knob.
low-knob-labelMinimum value—Accessible label of the low knob.

Events

EventDetailFlagsDescription
z-input-range:input · from InputMixin{ value: string | string[] }bubblesFires when the value changes; detail.value carries the value (two entries in range mode).

Data Hooks

AttributeValuesApplies toRoleDescription
data-disabled—descendantmarkerSet while the control is disabled.
data-dragging—descendantmarkerSet while a knob is being dragged.
data-fill-track—descendantmarkerMarks the fill element.
data-host-inner · from Hwc—descendantconfigMarks the rendered inner wrapper so force-prevent-rerender can adopt server-rendered DOM without re-rendering.
data-label-position—descendantmarkerSet to the label position (top/bottom).
data-multiple—descendantmarkerSet in two-knob range mode.
data-range-track—descendantmarkerMarks the track element.
data-reactive · from Hwc—descendantconfigOpts the marked child (config script, data source, icons, or template) into live re-parsing when its DOM mutates.

Child Content

script[data-fn="config"][type="application/json"]

JSON configuration script parsed by the base class (i18n, cls, stl, floating).

AttributeRequiredTypeDescription
data-fnyesconfigMarks the script as configuration (value: config).
data-reactivenobooleanRe-parses the configuration when the script mutates.

select[data-fn="data-source"]

Hidden select parsed into grouped option data by the base class.

AttributeRequiredTypeDescription
data-fnyesdata-sourceMarks the select as the data source (value: data-source).
data-reactivenobooleanRe-parses the options when the select mutates.

optgroup · repeatable

Groups options under a label.

AttributeRequiredTypeDescription
labelyesstringGroup header text; also the default group key.
disablednobooleanDisables every option in the group.
data-keynostringOverrides the group key used in the parsed data.
data-keywordsnocomma-separated stringComma-separated keywords stored with the group's data.

option · repeatable

One option entry within the group.

AttributeRequiredTypeDescription
valuenostringValue carried by this option in the parsed data.
disablednobooleanMakes the option non-selectable.
selectednobooleanMarks the option as initially selected.
data-keywordsnocomma-separated stringExtra search terms, comma-separated; searched alongside the label and value.

option · repeatable

One ungrouped option entry.

AttributeRequiredTypeDescription
valuenostringValue carried by this option in the parsed data.
disablednobooleanMakes the option non-selectable.
selectednobooleanMarks the option as initially selected.
data-keywordsnocomma-separated stringExtra search terms, comma-separated.

template[data-fn="icons"]

Instance-level icon repository.

AttributeRequiredTypeDescription
data-fnyesiconsMarks the template as an icon source (value: icons).
data-reactivenobooleanRe-parses the icons when the template mutates.

* · repeatable

One icon element.

AttributeRequiredTypeDescription
data-keyyesstringIcon key referenced by $icons.

template[data-fn="template"]

Deferred content template mounted by the base class.

AttributeRequiredTypeDescription
data-fnyestemplateMarks the template for deferred mounting (value: template).
data-reactivenobooleanRe-parses the template when it mutates.

CSS Classes

ClassRoleApplies toDescription
.z-input-rangerootz-input-rangeRoot class of the slider.
.z-input-range-fillelement.z-input-rangeThe filled track portion.
.z-input-range-knobelement.z-input-rangeThe draggable knob.
.z-input-range-labelelement.z-input-rangeThe value label.
.z-input-range-label-bottomelement.z-input-rangeLabel below the track.
.z-input-range-label-topelement.z-input-rangeLabel above the track.
.z-input-range-runnableelement.z-input-rangeThe interactive track area.

Keyboard

KeysActionWhen
ArrowLeft ArrowRight ArrowUp ArrowDownAdjusts the focused knob by one step.—
PageUp PageDownAdjusts the focused knob by ten steps.—
Home EndJumps to the minimum (low knob: its own minimum) or maximum.—

Accessibility

PartARIADescription
fill—Fill element; no ARIA attributes.
host-inneraria-label="${ariaLabel}" role="group"Slider group: role="group" labeled by aria-label.
knobaria-disabled="${this.disabled}" aria-label="${this.getKnobAriaLabel(type)}" aria-valuemax="${max}" aria-valuemin="${min}" aria-valuenow="${value}" aria-valuetext="${this.getAriaValueText(value)}" role="slider"Knob: role="slider" with aria-valuemin/aria-valuemax/aria-valuenow/aria-valuetext, labeled per knob, aria-disabled when disabled.
label—Value label; no ARIA attributes.
runnable—Track area; no ARIA attributes.
  • Each knob is a slider with live value text; in range mode the group text announces low to high.
  • The value submits through the hidden form input(s).