slider

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

Usage

Default

50

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

Props

Sortable data table
PropTypeDefaultDescription
valuenumber-The current value of the slider.
onChange(event: React.ChangeEvent<HTMLInputElement>) => void-Callback fired when the slider value changes.
minnumber0Minimum value for the slider.
maxnumber100Maximum value for the slider.
stepnumber1Step increment for the slider value.
theme"primary" | "secondary" | "tertiary" | "quaternary" | "clear"Configured DefaultTheme color for the slider.
state"" | "success" | "error" | "warning"-Visual state style for the slider.
size"xs" | "small" | "medium" | "large" | "xl"Configured DefaultSize of the slider control.
rounding"none" | "small" | "medium" | "large"Configured DefaultBorder radius for the slider.
shadow"none" | "light" | "medium" | "strong" | "intense"Configured DefaultBox shadow for the slider.
labelstring-Label for the slider (for accessibility).
showValuebooleantrueShow the numeric value next to the slider.
classNamestring-Additional CSS class names.
aria-labelstring-ARIA label for screen readers.
data-testidstring"slider"Test id for querying the component in tests.