Skip to content

Range

A readable native range control with an output. CSS only

Range
Copy this markup
<div class="ui-range">
<label for="density">Density</label>
<output for="density">60</output>
<input id="density" name="density" type="range" min="0" max="100" value="60">
</div>

Install

Styles and registration
import '@timelessui/components/css/tokens.css'
import '@timelessui/components/css/range.css'

Anatomy

Parts are authored in your own markup and identified by the selector below, so your CSS can target the same anatomy without loading Timeless styles. Required parts must be present for the component to work. Private data-ui-internal-* hooks are written by the runtime and must never be authored.

PartRequiredSelectorPurpose
hintNo[data-ui-part~='hint']Supporting text or the live <output> value.

Attributes

Every value below is implemented by the stylesheets this component ships. Boolean attributes are presence-based: author the attribute with no value, or omit it.

AttributeValuesDefaultDescription
data-ui-sizesm · md · lgmdTrack thickness, thumb diameter, and label size.

State

Native attributes, ARIA, and platform pseudo-classes are authoritative. Style state through the selectors below rather than adding your own state classes.

StateSourceHow to express it
invalidnativeNative :invalid, or aria-invalid="true".
disablednativeNative disabled.

Styling

Root identity: ui-range. Required stylesheets: tokens.css, range.css.

Set these custom properties to restyle the component:

Custom propertyControls
--ui-range-trackTrack thickness.
--ui-range-thumbThumb diameter.
Design tokens this component reads (8)

These are global Atmosphere tokens. Change them once at the theme level rather than per component.

--ui-bg-surface · --ui-fg · --ui-fg-muted · --ui-font-mono · --ui-line-strong · --ui-radius-pill · --ui-shadow-control · --ui-space-2

Accessibility

Keep the native elements, roles, and relationships shown in the example. Timeless adds only the state and keyboard coordination the platform does not already provide, and it never supplies your accessible names — those depend on your content.

Before JavaScript runs

This primitive is CSS only. There is nothing to register and nothing to wait for.

More examples

Open Range in StoryLite for variants, controls, and manual testing.