Atomx Docs
Components

Slider

An input where the user selects a value from within a given range, built on Radix UI.

Install

npx shadcn@latest add https://atomx.acau.net/r/slider.json

Usage

Slider is controlled via value / onValueChange and supports multiple thumbs by passing an array. Use min, max, and step to constrain the input range.

const [value, setValue] = React.useState([50])

<Slider value={value} onValueChange={setValue} min={0} max={100} step={1} />

Preview

Single value

Range (two thumbs)

Props

Slider extends React.ComponentPropsWithoutRef<typeof SliderPrimitive.Root>.

PropTypeNotes
valuenumber[]Controlled value(s). Length determines thumb count.
defaultValuenumber[]Initial value when uncontrolled.
onValueChange(value: number[]) => voidFires while dragging.
minnumberMinimum value. Defaults to 0.
maxnumberMaximum value. Defaults to 100.
stepnumberStep increment. Defaults to 1.
disabledbooleanDisable interaction.
orientation"horizontal" | "vertical"Slider axis. Defaults to "horizontal".