inputshwc
z-input-rangeRange Slider
Custom slider with a draggable knob, filled track, optional value label, and a two-knob range mode.
Attributes
| Attribute | Type | Default | Description |
|---|---|---|---|
multiple | boolean | false | Enables two knobs (low/high) selecting a range; the value submits as two entries. |
min | number | 0 | Minimum value (default 0). |
max | number | 100 | Maximum value (default 100). |
step | number | 1 | Step increment (default 1). |
label | string | boolean | false | Shows a value label following the knob. |
label-position | 'top' | 'bottom' | 'top' | Label placement relative to the track: top (default) or bottom. |
aria-label | string | '' | Accessible label of the slider group (defaults to the aria-label i18n text). |
Inherited from InputMixin
| Attribute | Type | Default | Description |
|---|---|---|---|
disabled | boolean | false | Disables the control so it cannot be interacted with. |
form | string | '' | Associates the hidden form input with a form by id, even when the component sits outside that form. |
name | string | '' | Field name for the hidden form input; array values submit as name[]. |
placeholder | string | '' | Placeholder text for the control's empty state. |
required | boolean | false | Marks the control as required. |
value | string | '' | Initial value of the control, synchronized with the hidden form input. |
Inherited from Hwc
| Attribute | Type | Default | Description |
|---|---|---|---|
i18n | string | '' | Per-instance text overrides as key: text pairs, merged over the global z-i18n script and the built-in defaults. |
floating | string | '' | Floating UI placement options (for example offset and shiftPadding) parsed as key: value pairs. |
force-prevent-rerender | boolean | false | Skips re-rendering after the first render; an existing data-host-inner child is adopted as the rendered DOM. |
template | string | '' | 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
| Attribute | Type | Default | Description |
|---|---|---|---|
cls | string | '' | Adds classes to named parts as key: classes pairs; a plain string targets the default part. |
stl | string | '' | 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
| Key | Default class | cls | stl | Description |
|---|---|---|---|---|
fill | — | yes | no | The filled portion of the track. |
host-inner | z-input-range | yes | yes | The slider root (default z-input-range); the default cls/stl target. |
knob | — | yes | no | The draggable knob. |
knob-dragging | — | yes | no | Class applied to the knob while dragging. |
label | — | yes | yes | The value label. |
label-bottom | — | yes | no | Class positioning the label below the track. |
label-top | — | yes | no | Class positioning the label above the track. |
runnable | — | yes | yes | The clickable/draggable track area. |
CSS Variables
| Variable | Default | Scope | Description |
|---|---|---|---|
--z-input-range-fill-bg | var(--z-primary) | .z-input-range-fill | Fill base color, mixed with transparency using --z-input-range-fill-bg-o. |
--z-input-range-fill-bg-o | 100% | .z-input-range-fill | Fill opacity percentage used in the color mix. |
--z-input-range-knob-bg | var(--z-bg) | .z-input-range-knob | Knob base color, mixed with transparency using --z-input-range-knob-bg-o. |
--z-input-range-knob-bg-o | 100% | .z-input-range-knob | Knob opacity percentage used in the color mix. |
--z-input-range-knob-border-color | var(--z-primary) | .z-input-range-knob | Knob border base color, mixed with transparency using --z-input-range-knob-border-color-o. |
--z-input-range-knob-border-color-o | 50% | .z-input-range-knob | Knob border opacity percentage used in the mix. |
--z-input-range-knob-radius | 9999px | .z-input-range-knob | Corner radius of the knob. |
--z-input-range-knob-shadow | var(--z-global-shadow) | .z-input-range-knob | Box shadow of the knob. |
--z-input-range-knob-size | 1rem | .z-input-range-knob | Diameter of the knob. |
--z-input-range-label-offset-y | 2.5rem | .z-input-range | Vertical offset of the value label from the track. |
--z-input-range-track-bg | var(--z-primary) | .z-input-range-runnable | Track base color, mixed with transparency using --z-input-range-track-bg-o. |
--z-input-range-track-bg-o | 20% | .z-input-range-runnable | Track opacity percentage used in the color mix. |
--z-input-range-track-height | 0.375rem | .z-input-range | Height of the track. |
--z-input-range-track-radius | var(--z-global-radius) | .z-input-range | Corner radius of the track. |
i18n Keys
| Key | Default | Placeholders | Description |
|---|---|---|---|
aria-label | Range slider | — | Default accessible label of the slider group. Used in: host-inner. |
aria-range-text | Range from {low} to {high} | low, high | Range value text template with {low} and {high}. |
aria-value-text | Value: {value} | value | Single-knob value text template with {value}. |
high-knob-label | Maximum value | — | Accessible label of the high knob. |
low-knob-label | Minimum value | — | Accessible label of the low knob. |
Events
| Event | Detail | Flags | Description |
|---|---|---|---|
z-input-range:input · from InputMixin | { value: string | string[] } | bubbles | Fires when the value changes; detail.value carries the value (two entries in range mode). |
Data Hooks
| Attribute | Values | Applies to | Role | Description |
|---|---|---|---|---|
data-disabled | — | descendant | marker | Set while the control is disabled. |
data-dragging | — | descendant | marker | Set while a knob is being dragged. |
data-fill-track | — | descendant | marker | Marks the fill element. |
data-host-inner · from Hwc | — | descendant | config | Marks the rendered inner wrapper so force-prevent-rerender can adopt server-rendered DOM without re-rendering. |
data-label-position | — | descendant | marker | Set to the label position (top/bottom). |
data-multiple | — | descendant | marker | Set in two-knob range mode. |
data-range-track | — | descendant | marker | Marks the track element. |
data-reactive · from Hwc | — | descendant | config | Opts 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).
| Attribute | Required | Type | Description |
|---|---|---|---|
data-fn | yes | config | Marks the script as configuration (value: config). |
data-reactive | no | boolean | Re-parses the configuration when the script mutates. |
select[data-fn="data-source"]
Hidden select parsed into grouped option data by the base class.
| Attribute | Required | Type | Description |
|---|---|---|---|
data-fn | yes | data-source | Marks the select as the data source (value: data-source). |
data-reactive | no | boolean | Re-parses the options when the select mutates. |
optgroup · repeatable
Groups options under a label.
| Attribute | Required | Type | Description |
|---|---|---|---|
label | yes | string | Group header text; also the default group key. |
disabled | no | boolean | Disables every option in the group. |
data-key | no | string | Overrides the group key used in the parsed data. |
data-keywords | no | comma-separated string | Comma-separated keywords stored with the group's data. |
option · repeatable
One option entry within the group.
| Attribute | Required | Type | Description |
|---|---|---|---|
value | no | string | Value carried by this option in the parsed data. |
disabled | no | boolean | Makes the option non-selectable. |
selected | no | boolean | Marks the option as initially selected. |
data-keywords | no | comma-separated string | Extra search terms, comma-separated; searched alongside the label and value. |
option · repeatable
One ungrouped option entry.
| Attribute | Required | Type | Description |
|---|---|---|---|
value | no | string | Value carried by this option in the parsed data. |
disabled | no | boolean | Makes the option non-selectable. |
selected | no | boolean | Marks the option as initially selected. |
data-keywords | no | comma-separated string | Extra search terms, comma-separated. |
template[data-fn="icons"]
Instance-level icon repository.
| Attribute | Required | Type | Description |
|---|---|---|---|
data-fn | yes | icons | Marks the template as an icon source (value: icons). |
data-reactive | no | boolean | Re-parses the icons when the template mutates. |
* · repeatable
One icon element.
| Attribute | Required | Type | Description |
|---|---|---|---|
data-key | yes | string | Icon key referenced by $icons. |
template[data-fn="template"]
Deferred content template mounted by the base class.
| Attribute | Required | Type | Description |
|---|---|---|---|
data-fn | yes | template | Marks the template for deferred mounting (value: template). |
data-reactive | no | boolean | Re-parses the template when it mutates. |
CSS Classes
| Class | Role | Applies to | Description |
|---|---|---|---|
.z-input-range | root | z-input-range | Root class of the slider. |
.z-input-range-fill | element | .z-input-range | The filled track portion. |
.z-input-range-knob | element | .z-input-range | The draggable knob. |
.z-input-range-label | element | .z-input-range | The value label. |
.z-input-range-label-bottom | element | .z-input-range | Label below the track. |
.z-input-range-label-top | element | .z-input-range | Label above the track. |
.z-input-range-runnable | element | .z-input-range | The interactive track area. |
Keyboard
| Keys | Action | When |
|---|---|---|
| ArrowLeft ArrowRight ArrowUp ArrowDown | Adjusts the focused knob by one step. | — |
| PageUp PageDown | Adjusts the focused knob by ten steps. | — |
| Home End | Jumps to the minimum (low knob: its own minimum) or maximum. | — |
Accessibility
| Part | ARIA | Description |
|---|---|---|
fill | — | Fill element; no ARIA attributes. |
host-inner | aria-label="${ariaLabel}" role="group" | Slider group: role="group" labeled by aria-label. |
knob | aria-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
lowtohigh. - The value submits through the hidden form input(s).