Skip to content
SevenUI
Sign inGet Pro
On this page

Slider

Displays a slider built on the Base UI Slider primitive, for picking a single value or a range with keyboard and pointer.

Displays a slider built on the UI SDK Slider component, for picking a single value or a range with keyboard and pointer.

Installation

Usage

Range

Pass an array to defaultValue (or value) to render one thumb per value. Each thumb is indexed automatically in the order its value appears in the array.

Examples

Vertical

Multiple thumbs

One thumb per array entry — three values give a three-thumb slider.

Disabled

API reference

The UI SDK flavour is built on UI SDK Slider. Its API is the SevenUI wrapper's, the same in both flavours: export names, props, data-slot values and the render prop, so code that uses only the SevenUI exports compiles against either flavour. What behaves differently, and any prop that is ignored or not supported, is listed below; code that imports a Base UI or third-party library directly needs changes. Switch to Base UI to read the prop tables, which describe that shared API in Base UI's terms.

Differences on UI SDK

  • The indicator ends at the value's share of the whole track, under the thumb, and a press on the track maps through the whole track, so the value can land up to half a thumb's share from where Base UI puts it. Each thumb's input of a range is bounded by its neighbours.
  • thumbCollisionBehavior, inputRef and a non-string locale are accepted and ignored.
  • Without a DirectionProvider, on a page with dir="rtl", ArrowRight moves the thumb right, following the page; Base UI's moves it left there. Under DirectionProvider both flavours behave the same.

Slider

Extends the Base UI Slider Root — all its props apply; the track, range indicator, and thumbs are built in. Pass value/defaultValue as an array: one thumb renders per entry, so [40] is a single-value slider and [20, 60] a range. With no value at all, a full-range two-thumb slider is rendered.

PropTypeDefault
valuenumber[]—
defaultValuenumber[]—
min / maxnumber0 / 100
stepnumber1
orientation"horizontal" | "vertical""horizontal"

Was this page helpful?