Slider
A single-value range slider with optional step dots, interval markers, and a focus tooltip, in horizontal or vertical layouts.
Overview
Slider wraps a native <input type="range"> with a styled track, thumb, focus tooltip, and optional step dots/markers. It's a controlled component — pass value and onChange to drive it, the same way you would a plain range input.
It supports a single numeric value (there's no dual-thumb/range-selection mode), a horizontal or vertical layout, and can render evenly-spaced interval markers either at a fixed spacing or auto-fitted to the available width.
Import
import { Slider } from '@unflow.io/ui/components/Slider';Props
| Prop | Type | Default | Description |
|---|---|---|---|
name | string | — | Required. Name attribute for the underlying range input; also used to associate the label |
value | number | 0 | Current value of the slider (controlled) |
onChange | ChangeEventHandler<HTMLInputElement> | — | Called with the native change event whenever the range input value changes |
label | string | — | Field label rendered above the slider |
hint | string | — | Helper text rendered below the slider |
min / max | number | 0 / 100 | Minimum and maximum allowed values |
steps | number | 1 | Granularity of the native range input (the step attribute) |
interval | number | same as steps | Spacing (in value units) between rendered step dots/markers |
autoInterval | boolean | false | Computes the marker interval automatically from the available track width instead of using a fixed interval |
direction | 'horizontal' | 'vertical' | 'horizontal' | Layout axis of the slider |
startLabel / endLabel | string | — | Text rendered before/after the track |
startIcon / endIcon | ReactNode | — | Icon rendered before/after the track |
disableStepDots | boolean | false | Hides the small dots marking each step/interval on the track |
disableStepMarkers | boolean | false | Hides the numeric labels below (or beside) the track |
disableTooltip | boolean | false | Hides the value tooltip that appears above the thumb on focus |
disabled | boolean | — | Disables the input |
required | boolean | — | Marks the field as required |
disableRequiredSymbol | boolean | — | Hides the "required" indicator next to the label |
status / statusMessage | 'valid' | 'invalid' | 'error' / string | — | Validation state and accompanying message shown below the slider |
Basic usage
const [value, setValue] = useState(25);
<Slider
name="volume"
label="Volume"
value={value}
onChange={(e) => setValue(Number(e.currentTarget.value))}
/>Interval markers
Set steps/interval for fixed spacing, or autoInterval to let the slider fit as many markers as the available width allows.
const [value, setValue] = useState(40);
<Slider
name="progress"
label="Progress"
value={value}
onChange={(e) => setValue(Number(e.currentTarget.value))}
steps={10}
interval={20}
autoInterval
/>Vertical
const [value, setValue] = useState(60);
<Slider
name="vertical-volume"
label="Volume"
direction="vertical"
value={value}
onChange={(e) => setValue(Number(e.currentTarget.value))}
startLabel="Min"
endLabel="Max"
/>Disabled
<Slider name="disabled-slider" label="Volume" value={30} disabled />Customization (slots & slotProps)
| Slot | Type | Description |
|---|---|---|
dot | (dotProps: { offset: number; value: number; isInsideRange: boolean }) => ReactNode | Renders custom content inside each step dot |
thumb | ReactNode | Overrides the default thumb content |
| Slot Prop | Props | Description |
|---|---|---|
root | BaseHTMLProps<HTMLDivElement> | Outermost container (labels/icons + track) |
startLabel / endLabel | BaseHTMLProps<HTMLParagraphElement> | Start/end label elements |
inputRoot | BaseHTMLProps<HTMLDivElement> | Wrapper around the input, track, thumb and tooltip |
dotsRoot / dot | BaseHTMLProps<HTMLDivElement> / BaseHTMLProps<HTMLSpanElement> | Step dots container and each individual dot |
markersRoot / marker | BaseHTMLProps<HTMLDivElement> | Interval markers container and each individual marker label |
track / progressTrack | BaseHTMLProps<HTMLSpanElement> | The full track and the filled progress portion |
thumb | BaseHTMLProps<HTMLSpanElement> | The draggable thumb element |
tooltip | BaseHTMLProps<HTMLSpanElement> | The focus tooltip showing the current value |
Accessibility
- The native
<input type="range">carries the implicitsliderrole, so screen readers announce the label, current value, and min/max out of the box. label/hint/statusare wired through InputLabel, keeping the label associated with the input viaid/nameand exposing status messages.- The focus tooltip uses
role="tooltip"and appears on keyboard focus, not just on drag, so keyboard users get the same value feedback as mouse users. - Step dots and interval markers are purely decorative (
inert) and never receive focus or get announced.
Radio
A styled native radio input, plus two higher-level building blocks — a card-style RadioArea and a labeled RadioInput — for building single-choice groups.
Input
A flexible text field supporting single-line, multiline, password, and all HTML input types. Accepts icons, action elements, inline status indicators, and a clearable value.