A labeled slider with one handle, or two for a start and end with range; 0–100 unless min and max say otherwise.
A Markdown brief for Claude, Cursor or v0: install, setup, props and a complete example.
For a value where the rough position matters more than the exact number: volume, a price range.
An exact number? Text Input with type="number".
Native range inputs, each with its own accessible name; with formatValue, each handle also announces its formatted value, like "$40". Arrow keys and Page Up/Down move the handle.
import { Slider } from '@idyeah/diya'Stable since 1.0.0
labelRequiredstringVisible label above the slider; also names the inputs for assistive tech. Hide it with hideLabel.
disabledbooleanPrevents dragging and dims the slider.
Default false
formatValue(value: number) => stringFormats every number the slider shows (its values and marks) and what screen readers announce for each handle, such as (value) => '$' + value. Defaults to the plain number.
hideLabelbooleanHides the visible label; the inputs keep it as their accessible name.
Default false
maxstring | numberHighest value; defaults to 100. Numeric strings work too.
Default 100
minstring | numberLowest value; defaults to 0. Numeric strings work too, so react-hook-form's register() spreads cleanly.
Default 0
rangebooleanSingle mode (the default): one handle, leave unset or false. Range mode: two handles for a start and end; the handles cannot cross.
showMarksbooleanShows a visible scale of five evenly spaced numbers from min to max under the track.
Default false
showValuesbooleanShows the current numbers above the track (the minimum and the value, or start and end in range mode); defaults to true.
Default true
stepstring | numberIncrement between values, greater than 0; defaults to 1. Numeric strings work too.
Default 1
range={false} (the default)defaultValuenumberThe starting value when uncontrolled; defaults to min, and a form reset returns to it.
onValueChange(value: number) => voidCalled with the new value while dragging or on a track click.
valuenumberThe current value when controlled; out-of-range numbers are clamped. Pair it with onValueChange.
range={true}defaultValue[number, number]The starting [start, end] when uncontrolled; defaults to [min, max], and a form reset returns to it.
onValueChange(value: [number, number]) => voidCalled with the new [start, end] while dragging or on a track click.
value[number, number]The current [start, end] when controlled, with start ≤ end. Pair it with onValueChange.
Also takes every native <input> attribute, such as name, id or data-*.