qds-slider selects a number or a two-thumb numeric interval. It uses stable native range inputs, ordinary keyboard focus and QDS theme tokens. Use numeric inputs alongside sliders when precise entry matters.
Interactive demo · Generated API
<script type="module" src="/assets/components/slider/qds-slider.js"></script>
<qds-slider label="Entry multiple" name="multiple" min="4" max="16" step="0.1" value="8.4" unit="×"></qds-slider>
<qds-slider label="Sensitivity interval" name="sensitivity" range min="4" max="16" step="0.1" value="[7,11]" unit="×"></qds-slider>
value property is a number, or a cloned [number, number] in range mode. Owner writes are silent. Strings, nonfinite or missing entries normalize to min; an absent range upper endpoint defaults to the last valid step. Pairs sort lower first.value attribute is a scalar JSON number or JSON pair and supplies the reset default. Changing a default does not overwrite a dirty current value. defaultValue reads/writes that attribute. Changing bounds, step or range normalizes silently.name entries, lower first. Native reset restores the current default. Browser string-state restoration is silent; malformed state is ignored. Disabled controls are omitted; readonly controls retain values and focus. External form IDs are supported.invalid, error-text, setCustomValidity, checkValidity, reportValidity, native invalid events and input/blur/submit feedback timing remain available.label, aria-label or external aria-labelledby text names the scalar; ranges append lower-label / upper-label (defaults Lower/Upper). Tab order stays lower then upper even when values coincide.orientation="vertical" places min at the bottom. Native hit targets are 44px. Value text is visible and supplied as aria-valuetext. Both themes, RTL and forced colors use semantic tokens.const slider = document.querySelector('qds-slider');
slider.valueFormatter = (value, thumb) => `${value.toFixed(1)} times EBITDA`;
slider.addEventListener('input', ({ detail }) => console.log(detail.value, detail.thumb));
slider.addEventListener('change', ({ detail }) => console.log('Committed', detail.value));
locale uses Intl.NumberFormat and optional plain unit text. Invalid locale or formatter errors fall back safely. Text is never interpreted as HTML.{ component, value, range, thumb }, with cloned numeric values. Native input events are contained. Input reports actual user edits; change reports commits. Keyboard edits commit individually; drag commits on release/cancellation. Owner writes, reset and restore emit neither.Generated QdsSliderComponent preserves numeric scalar/pair values, structural formatter callbacks and typed input/change events through native controls and Angular forms. Underwriting pairs sliders with precise numeric entry, applies a sensitivity band to a visible fictional illustration, and supports disabled/reset behavior. Draft/applied values remain local and reset on navigation/reload.