Ranges
Sliders for numeric input with optional steps.
Setup
Range styles are included in Manifest CSS or a standalone stylesheet, both referencing theme variables.
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/mnfst@latest/lib/manifest.min.css" />
Default
<input type="range" min="0" max="100" value="50" />
Utilities
Ranges accept Manifest utility classes, which can be stacked in any combination.
Colors
<!-- Brand variant -->
<input type="range" class="brand" min="0" max="100" value="50" />
<!-- Accent variant -->
<input type="range" class="accent" min="0" max="100" value="50" />
<!-- Positive variant -->
<input type="range" class="positive" min="0" max="100" value="50" />
<!-- Negative variant -->
<input type="range" class="negative" min="0" max="100" value="50" />
Size
<!-- Small variant -->
<input type="range" class="sm" min="0" max="100" value="50" />
<!-- Large variant -->
<input type="range" class="lg" min="0" max="100" value="50" />
Markers
Use a <datalist> element to add tick marks with option labels to your range input.
<label>
<input type="range" min="0" max="100" step="25" value="50" list="volume-ticks" />
<datalist id="volume-ticks">
<option value="0" label="0"></option>
<option value="25" label="25"></option>
<option value="50" label="50"></option>
<option value="75" label="75"></option>
<option value="100" label="100"></option>
</datalist>
</label>
Labels
Placing the range and text inside a <label> automatically stacks them with spacing.
<label>
Volume
<input type="range" min="0" max="100" value="50" />
</label>
To horizontally inline the label text with the range, place the text in a <data> element. This is used as a CSS hook with no semantic impact.
<label>
<data>Volume</data>
<input type="range" min="0" max="100" value="50" />
</label>
Styles
Theme
Default ranges use the following theme variables:
| Variable | Purpose |
|---|---|
--color-field-surface |
Track background color |
--color-field-surface-hover |
Track hover background color |
--color-field-inverse |
Thumb color (mixed with the field surface) |
--spacing-field-height |
Thumb size |
--spacing |
Track height |
--radius |
Border radius for track corners |
--transition |
Transition for interactive states |
Customization
Modify base range styles with custom CSS for the input[type=range] selector. Overriding the field theme variables keeps both color modes working.
input[type=range] {
--color-field-surface: color-mix(in oklch, var(--color-brand-surface) 30%, transparent);
--color-field-surface-hover: color-mix(in oklch, var(--color-brand-surface) 45%, transparent);
--color-field-inverse: var(--color-brand-content);
}
Article does not exist
There is no documentation at this path.