Slider

Horizontal or vertical numeric range control.

Add it to your project

Eject the complete slider group, then import from its generated local barrel. The copied source and CSS belong to your application.

bash
pnpm exec toucan eject slider
app.tsx
import { Slider } from '@/components/toucan/slider';

Use when

Users adjust an approximate numeric value within a known range.

Avoid when

An exact number is important; use a numeric Input.

Example

Value: 50

API reference

Generated from packages/react/src/components. Only Toucan-specific props are listed; forwarded native props remain available as noted for each export.

Slider

Slider

Props type: SliderProps

NameTypeDefaultRequiredDescription
defaultValuenumberundefinedNoInitial value when the component is uncontrolled.
disabledbooleanfalseNoPrevents interaction when true.
labelstringundefinedNoVisible or accessible label for the control.
maxnumber100NoMaximum permitted value.
minnumber0NoMinimum permitted value.
onChange(value: number) => voidundefinedNoCalled when the value changes.
orientation"horizontal" | "vertical"'horizontal'NoHorizontal or vertical orientation.
stepnumber1NoIncrement between permitted numeric values.
valuenumberundefinedNoControlled value.

Also accepts the native div attributes that are not replaced by a Toucan prop.

Type exports

SliderProps

Accessibility

  • Provides slider role, value metadata, labelling, and keyboard increments.

Token families

sliderfocus

Related components