Range

Native range input with browser-owned value, keyboard interaction and reset

Range

Use native input[type="range"] for a basic slider. The browser owns pointer and keyboard interaction, bounds, stepping, submission and reset. No JavaScript is required.

Imports

Individual example prerequisites (including composition and demo actions):

@import "@duskmoon-dev/core/base.css";
@import "@duskmoon-dev/core/themes/sunshine";
@import "@duskmoon-dev/core/components/range.css";
@import "@duskmoon-dev/core/components/form-group.css";
@import "@duskmoon-dev/core/components/button.css";

base.css supplies global focus/utility definitions and shared spacing/shape tokens; use your framework reset when appropriate. Substitute the Moonlight theme for dark forms.

Aggregate: @duskmoon-dev/core with Tailwind v4; without Tailwind use @duskmoon-dev/core/standalone.css. Individual: @duskmoon-dev/core/components/range.css plus a theme and your normal reset/typography. Legacy components/form.css includes Range. Extensionless components/range exports generated css and styles.

Native Range

Stepped volume

0 to 100, in steps of 5.

Do not add static aria-valuenow: native Range exposes its current value itself. Do not overlay a decorative fill or value label unless an application updates it. An optional output must synchronize on input and after form reset; CSS cannot read a changing input value to update text or a percentage.

Sizes And States

Sizes: .range-xs, .range-sm, default/medium, .range-lg. Colors: .range-primary, secondary, tertiary, info, success, warning, error. Default uses on-surface; modifiers color the thumb. Visible keyboard focus uses an outline and remains visible in forced colors.

Small and disabled ranges

Advanced Slider

The custom .slider track/thumb API is retained separately. It does not belong on a native range input and needs an interaction controller for values, keyboard, dragging, ARIA, labels and reset. See Slider.