# Range Slider (`<z-input-range>`)

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

- **Kind:** hwc
- **Category:** inputs
- **Inherits:** `InputMixin`, `Hwc`, `Base`

## Attributes

| Attribute | Type | Default | From | 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 | From | Description |
| --- | --- | --- | --- | --- |
| `disabled` | `boolean` | `false` | `InputMixin` | Disables the control so it cannot be interacted with. |
| `form` | `string` | `''` | `InputMixin` | Associates the hidden form input with a form by id, even when the component sits outside that form. |
| `name` | `string` | `''` | `InputMixin` | Field name for the hidden form input; array values submit as `name[]`. |
| `placeholder` | `string` | `''` | `InputMixin` | Placeholder text for the control's empty state. |
| `required` | `boolean` | `false` | `InputMixin` | Marks the control as required. |
| `value` | `string` | `''` | `InputMixin` | Initial value of the control, synchronized with the hidden form input. |

### Inherited from `Hwc`

| Attribute | Type | Default | From | Description |
| --- | --- | --- | --- | --- |
| `i18n` | `string` | `''` | `Hwc` | Per-instance text overrides as `key: text` pairs, merged over the global `z-i18n` script and the built-in defaults. |
| `floating` | `string` | `''` | `Hwc` | Floating UI placement options (for example `offset` and `shiftPadding`) parsed as `key: value` pairs. |
| `force-prevent-rerender` | `boolean` | `false` | `Hwc` | Skips re-rendering after the first render; an existing `data-host-inner` child is adopted as the rendered DOM. |
| `template` | `string` | `''` | `Hwc` | 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 | From | Description |
| --- | --- | --- | --- | --- |
| `cls` | `string` | `''` | `Base` | Adds classes to named parts as `key: classes` pairs; a plain string targets the default part. |
| `stl` | `string` | `''` | `Base` | Adds inline styles to named parts as `key: styles` pairs; a plain string targets the default part. |

## Styling Parts (`cls` / `stl`)

Default `cls` target: `host-inner`. Default `stl` target: `host-inner`.

| Key | Default class | cls | stl | Description |
| --- | --- | --- | --- | --- |
| `fill` | — | ✓ | — | The filled portion of the track. |
| `host-inner` | `z-input-range` | ✓ | ✓ | The slider root (default `z-input-range`); the default `cls`/`stl` target. |
| `knob` | — | ✓ | — | The draggable knob. |
| `knob-dragging` | — | ✓ | — | Class applied to the knob while dragging. |
| `label` | — | ✓ | ✓ | The value label. |
| `label-bottom` | — | ✓ | — | Class positioning the label below the track. |
| `label-top` | — | ✓ | — | Class positioning the label above the track. |
| `runnable` | — | ✓ | ✓ | The clickable/draggable track area. |

## Reference inventories

- [CSS Variables (14)](https://next.0build.dev/docs/components/input-range/css-vars.md)
- [CSS Classes (7)](https://next.0build.dev/docs/components/input-range/css-classes.md)
- [Accessibility (5 ARIA parts)](https://next.0build.dev/docs/components/input-range/accessibility.md)

## i18n Keys

| Key | Default | Description |
| --- | --- | --- |
| `aria-label` | `Range slider` | Default accessible label of the slider group. |
| `aria-range-text` | `Range from {low} to {high}` | Range value text template with `{low}` and `{high}`. |
| `aria-value-text` | `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 | Cancelable | Detail | Description |
| --- | --- | --- | --- |
| `z-input-range:input` | — | `{ value: string \| string[] }` | 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` | — | `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` | — | `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">` — JSON configuration script parsed by the base class (i18n, cls, stl, floating).

  | Attribute | Required | Type | Description |
  | --- | --- | --- | --- |
  | `data-fn` | ✓ | `config` | Marks the script as configuration (value: `config`). |
  | `data-reactive` | — | `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` | ✓ | `data-source` | Marks the select as the data source (value: `data-source`). |
  | `data-reactive` | — | `boolean` | Re-parses the options when the select mutates. |

  - `<optgroup>` — Groups options under a label.

    | Attribute | Required | Type | Description |
    | --- | --- | --- | --- |
    | `label` | ✓ | `string` | Group header text; also the default group key. |
    | `disabled` | — | `boolean` | Disables every option in the group. |
    | `data-key` | — | `string` | Overrides the group key used in the parsed data. |
    | `data-keywords` | — | `comma-separated string` | Comma-separated keywords stored with the group's data. |

    - `<option>` — One option entry within the group.

      | Attribute | Required | Type | Description |
      | --- | --- | --- | --- |
      | `value` | — | `string` | Value carried by this option in the parsed data. |
      | `disabled` | — | `boolean` | Makes the option non-selectable. |
      | `selected` | — | `boolean` | Marks the option as initially selected. |
      | `data-keywords` | — | `comma-separated string` | Extra search terms, comma-separated; searched alongside the label and value. |

  - `<option>` — One ungrouped option entry.

    | Attribute | Required | Type | Description |
    | --- | --- | --- | --- |
    | `value` | — | `string` | Value carried by this option in the parsed data. |
    | `disabled` | — | `boolean` | Makes the option non-selectable. |
    | `selected` | — | `boolean` | Marks the option as initially selected. |
    | `data-keywords` | — | `comma-separated string` | Extra search terms, comma-separated. |

- `<template data-fn="icons">` — Instance-level icon repository.

  | Attribute | Required | Type | Description |
  | --- | --- | --- | --- |
  | `data-fn` | ✓ | `icons` | Marks the template as an icon source (value: `icons`). |
  | `data-reactive` | — | `boolean` | Re-parses the icons when the template mutates. |

  - `<*>` — One icon element.

    | Attribute | Required | Type | Description |
    | --- | --- | --- | --- |
    | `data-key` | ✓ | `string` | Icon key referenced by `$icons`. |

- `<template data-fn="template">` — Deferred content template mounted by the base class.

  | Attribute | Required | Type | Description |
  | --- | --- | --- | --- |
  | `data-fn` | ✓ | `template` | Marks the template for deferred mounting (value: `template`). |
  | `data-reactive` | — | `boolean` | Re-parses the template when it mutates. |

## 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. | — |

## Notes

- Clicking the track moves the nearest knob; dragging suppresses the follow-up click.
- In range mode the knobs cannot cross; the fill spans between them.

## Guides

- [Styling with cls and stl](https://next.0build.dev/docs/guides/styling.md)
- [Translating Components](https://next.0build.dev/docs/guides/i18n.md)
- [Icon Resolution](https://next.0build.dev/docs/guides/icons.md)
- [The data-source Convention](https://next.0build.dev/docs/guides/data-source.md)
- [Openers & Triggers](https://next.0build.dev/docs/guides/triggers.md)
- [Dialog Behavior](https://next.0build.dev/docs/guides/dialogs.md)
- [Utilities](https://next.0build.dev/docs/guides/utilities.md)
- [Runtime](https://next.0build.dev/docs/guides/runtime.md)

## Related

- [PIN Input](https://next.0build.dev/docs/components/input-pin.md)
- [Time Input](https://next.0build.dev/docs/components/input-time.md)
