slider

The Slider component allows users to select a value from a range.

Usage & Examples

Default

50
default.tsx

const [value, setValue] = useState(50);
<Slider
  min={0}
  max={100}
  step={1}
  value={value}
  onChange={(e) => setValue(Number(e.target.value))}
/>

Props API

33 props
Columns
slider props API
Default
Description
aria-describedbystringNoariaId of external element(s) that describe the slider.
aria-invalidboolean | "true" | "false"NoariaMarks the slider as invalid.
aria-labelstringNoariaAccessible label for the slider if no visible label is provided.
aria-labelledbystringNoariaId of external element(s) that label the slider.
aria-orientation"horizontal" | "vertical"Noaria"horizontal"Orientation of the slider.
aria-requiredboolean | "true" | "false"NoariaMarks the slider as required for assistive technology.
aria-valuemaxnumberNoariaExplicit maximum value for assistive technology.
aria-valueminnumberNoariaExplicit minimum value for assistive technology.
aria-valuenownumberNoariaExplicit current numeric value for assistive technology.
aria-valuetextstringNoariaHuman-friendly text alternative for the current value.
classNamestringNostylingAdditional CSS class names for custom styling.
data-testidstringNotestingBackward-compatible alias for test ID attributes.