Slider

Loading...

Installation

Install the component via the CLI in one command.

npx shadcn@latest add @intentui/slider

Composed components

When you install this component via the CLI, it automatically loads all composed components, so you don’t need to add them individually.

Manual installation

Use this approach if you prefer to install and wire up the component yourself instead of using the CLI.

npm install react-aria-components tailwind-merge

Examples

Step

Set a step value on the slider, and it will increment or decrement by that fixed amount each time you adjust it.

Loading...

Range

By passing an array to the defaultValue or value props, you can create a range slider.

Loading...

Orientation

You can change the orientation of the slider to vertical.

Loading...

Suffix and prefix

Sometimes you need to add a prefix or suffix to the slider, like a volume icon.

Loading...

Description

Add a description to the slider.

Loading...

Controlled

You can control the slider's value by using the value prop.

Loading...

Disabled

When the slider is disabled, it appears grayed out and becomes non-interactive.

Loading...

Component API

Slider

Slider extends the React Aria Components <Slider> component.

classNamestring

SliderFill

SliderFill extends the React Aria Components <SliderFill> component.

classNamestring

SliderGroup

SliderGroup extends the native <div> element.

classNamestring

SliderOutput

SliderOutput extends the React Aria Components <SliderOutput> component.

classNamestring

SliderThumb

SliderThumb extends the React Aria Components <SliderThumb> component.

classNamestring

SliderTrack

SliderTrack extends the React Aria Components <SliderTrack> component.

classNamestring

See the React Aria for the full API reference.

Design