Primitives
Primitive

Slider

Interactive control for selecting a value or range from a continuous scale

The slider lets users pick a value, or a range, by dragging a thumb along a track. Use it for volume, brightness, price ranges, and other continuous settings where quick adjustment matters more than typing an exact number.

Preview

Volume

Installation

Usage

Composition

SliderLabel and SliderValue are optional children that render above the track, so a header row (the label and value side by side) sits directly above the slider control:

For content below the track, render it as a sibling of Slider rather than a child (for example, a <FieldDescription> inside the enclosing <Field>).

Examples

Controlled

Use value and onValueChange to control the slider state.

Controlled
50

Range Slider

Pass an array value to render two thumbs and select a range.

Price range

With Steps

Use step to snap to discrete values, and showSteps to mark them on the track.

Step: 25

With Value Display

Add SliderValue to show the current value beside the slider.

Progress
75

Vertical Orientation

Set orientation="vertical" to lay the slider out vertically.

Variants

Use variant to change the slider's visual style.

VariantDescription
defaultA round thumb centered on the track.
containedThe thumb aligns to the track edges at min and max.
squareThumbA square thumb in place of the round default.

With Reference Scale

Render annotations like a reference scale as a sibling of Slider. Content outside the Slider root doesn't need slider context, so it skips the label/value composition rules; a SliderLabel child still keeps the visible label above the track.

Storage size
5 GB20 GB35 GB

Disabled State

Set disabled to prevent interaction.

Form Integration

Slider works with two submission flows. With Base UI's onFormSubmit, values come from registered Fields, so wrap each slider in <Field name="..."> (and compose with Fieldset for multi-thumb groups so each thumb keeps its own aria-label under a shared legend). With a native onSubmit, Slider's hidden input makes name sufficient on its own. The example below shows both. See the Forms guide for more patterns.

Using onFormSubmit — wrap each slider in Field.

Volume
50
Price range
20 – 80

Using native onSubmit — put name directly on Slider.

Volume
50

Accessibility

The slider is operable from the keyboard: focus a thumb, then use the arrow keys to adjust by step, Home/End to jump to the min and max, and PageUp/PageDown for larger increments.

Give the slider an accessible name when there is no visible SliderLabel. For a range slider, use getAriaLabel so each thumb gets its own label.

API Reference

Slider

Prop

Additional Props

Slider inherits all props from Base UI Slider, including orientation, step, value, defaultValue, onChange, and accessibility props.