Skip to content

Slider

An input where the user selects a value from within a given range.

Install

Bash
npx @madeui/cli add slider

Usage

TSX
import { Slider } from '@/components/ui/slider';

Range

Pass an array to render one thumb per value.

Vertical

Use orientation="vertical" for a vertical slider.

Controlled

Pass value and onValueChange to control the slider and read its value.

40

Disabled

Use the disabled prop to disable the slider.

API reference

Built on Base UI Slider. All props are forwarded to the Base UI Root (value, defaultValue, min, max, step, orientation, disabled, onValueChange, …) — see the Base UI Slider API reference. The component renders the control, track, indicator, and thumbs itself (with thumbAlignment="edge") and accepts a style prop (StyleXStyles, merged last) on the root.

Was this page helpful?