A range input for selecting numeric values. Supports single value, range selection, step marks, and both horizontal and vertical orientations.

import Slider from "@radui/ui/Slider"
Example
React
"use client" import Slider from "@radui/ui/Slider" const SliderExample = () => { return ( <div className="flex flex-col gap-6 w-[280px]"> <Slider aria-label="Volume" defaultValue={40} min={0} max={100} /> <Slider aria-label="Brightness" defaultValue={70} min={0} max={100} /> <Slider aria-label="Contrast" defaultValue={20} min={0} max={100} disabled /> </div> ) } export default SliderExample
  • Single value or a range with several thumbs; thumbs can push, swap or stop at each other
  • Arrow keys step, Shift steps by largeStep, PageUp and PageDown step by a multiple, Home and End jump
  • Horizontal or vertical, with step marks and custom marks
  • Each thumb submits its value through a hidden input and is announced with aria-valuetext
  • onValueChange fires while dragging; onValueCommit fires when the drag ends

Import all parts of the component and piece them together.

React
import Slider from "@radui/ui/Slider" export default () => { return ( <Slider.Root> <Slider.Track> <Slider.Range> <Slider.Thumb aria-label="Value" /> </Slider.Range> </Slider.Track> </Slider.Root> ) }

The root Slider component.

PropTypeDefault
value
number | number[]—
defaultValue
number | number[]—
min
number0
max
number100
step
number1
pageStepMultiplier
number10
thumbAlignment
'center' | 'edge''center'
minStepsBetweenValues
number0
orientation
enum
horizontal
disabled
booleanfalse
showStepMarks
booleanfalse
formatValue
function—
onValueChange
function—
onValueCommit
function—
thumbCollisionBehavior
"none" | "push" | "swap""none"
format
Intl.NumberFormatOptions—
locale
Intl.LocalesArgument—
largeStep
numberstep × 10
form
string—

An <output> showing the current value formatted with the root's formatValue; a range slider shows both values.

PropTypeDefault
children
(formatted: string[], values: number[]) => ReactNode—
ShortcutDescription
Tab

Moves focus to the slider thumb.

ArrowRight

Increases the value by one step in left-to-right layouts and decreases it in right-to-left layouts.

ArrowUp

Increases the value by one step.

ArrowLeft

Decreases the value by one step in left-to-right layouts and increases it in right-to-left layouts.

ArrowDown

Decreases the value by one step.

Home

Moves the focused thumb to the minimum value.

End

Moves the focused thumb to the maximum value.

PageUp

For a single-thumb Slider, increases the value by step multiplied by pageStepMultiplier.

PageDown

For a single-thumb Slider, decreases the value by step multiplied by pageStepMultiplier.

ReferenceWhat Rad UI follows
Slider pattern

Uses slider semantics on each focusable thumb with value range attributes, orientation, and optional aria-valuetext from formatValue.