Slider

Pick a number, or a range, by dragging a thumb along a track.
Stable
Web
iOS
Android
@advui/core
Source
JSX
<Slider aria-label="Playground slider" defaultValue={40} />
size

Installation

pnpm
pnpm add @advui/core
npm
npm install @advui/core

Usage

import { Slider } from '@advui/core'

<Slider aria-label="Volume" defaultValue={40} />
<Slider aria-label="Price" defaultValue={[20, 80]} />

Examples

Single value

Controlled, with a visible label and value.
40%

Range

Two thumbs with currency value text.
$40 – $160

API reference

Slider

PropTypeDefaultDescription
valuenumber | number[]—A number for one thumb, or an array for a range.
defaultValuenumber | number[]—Starting `value` when uncontrolled.
onValueChange(value: number | number[]) => void—Called while the value changes, in the same shape you passed.
onValueCommit(value: number | number[]) => void—Called when a drag ends.
minnumber0Lowest value.
maxnumber100Highest value.
stepnumber1Increment.
size'sm' | 'md' | 'lg''md'Thumb and track size.
orientation'horizontal' | 'vertical''horizontal'Direction of the track.
disabledboolean—Prevent interaction.
aria-labelstring—Accessible name. Required when there is no visible label.
aria-labelledbystring—The id of a visible label that names the slider.
getValueText(value: number) => string—Readable value for screen readers, e.g. a currency.
thumbLabelsstring[]—Names for range thumbs. Default: “Minimum” / “Maximum”.

Accessibility

  • Each thumb has role="slider" with aria-valuemin, aria-valuemax, aria-valuenow and optional aria-valuetext.
  • Range thumbs are named separately (“Price, Minimum” / “Price, Maximum”).
  • On iOS and Android, VoiceOver and TalkBack adjust the value with swipe gestures (increment / decrement actions), and thumbs have a 44pt touch target.
  • Disabled sliders leave the tab order and are announced as disabled.
Keyboard interactions
KeyAction
← → / ↑ ↓Decrease / increase by one step.
Page Up / Page Down, Shift + arrowChange by ten steps.
Home / EndJump to the minimum / maximum.

Responsive behavior

Fills its container horizontally; vertical sliders take their height from the parent.

Platform notes

Web
Pointer, touch and keyboard input.
iOS
Drag the thumb, or swipe up / down with VoiceOver.
Android
Drag the thumb, or use TalkBack volume-key / swipe adjustments.
Since v0.2.0Last updated Nov 2, 2026Edit this page on GitHub