Zephora UI

Form

Slider

Single-thumb slider with pointer drag, track click, tick marks, vertical orientation and full keyboard support.

Import

import { Slider } from "@zephora/react";

Examples

Basic

`showValue` renders the current value next to the track.

Steps and marks

050100

Controlled

Brightness: 30%

Range

`range` renders two thumbs; `tooltip` shows a value bubble while a thumb is dragged or focused, and `onValueCommit` fires once at the end of a change series.

2060

API

Slider props

PropTypeDefaultDescription
valuenumberControlled value.
defaultValuenumberminInitial value in uncontrolled mode.
onValueChange(value: number) => voidCalled with the new value on every change.
rangebooleanfalseTwo-thumb range mode. Use rangeValue / defaultRangeValue / onRangeChange.
rangeValue[number, number]Controlled [low, high] pair (range mode).
defaultRangeValue[number, number][min, max]Initial [low, high] pair in uncontrolled range mode.
onRangeChange(value: [number, number]) => voidCalled with the new [low, high] pair on every change (range mode).
onValueCommit(value: number | [number, number]) => voidCalled once at the end of a change series (pointer release / key release) with the final value.
minnumber0Minimum value.
maxnumber100Maximum value.
stepnumber | null1Snap increment. Pass null to snap exclusively to marks values (arrow keys then move between marks).
orientation"horizontal" | "vertical""horizontal"Track direction.
marksSliderMark[]Tick marks rendered along the track: { value, label? }.
showValuebooleanfalseShows the current value next to the track.
tooltipboolean | "always"falseShows a value bubble above a thumb while dragged or focused; "always" keeps it visible.
disabledbooleanfalseDisables interaction.
aria-label / aria-labelledbystringAccessible name for the thumb (role="slider").
unstyledbooleanfalseHeadless mode — drops Zephora classes so your own CSS can style it.
…restHTMLAttributes<HTMLDivElement>Forwarded to the root wrapper element.

Keyboard

KeyAction
Arrow Right / Arrow UpIncreases the value by step.
Arrow Left / Arrow DownDecreases the value by step.
Page Up / Page DownChanges the value by 10 × step.
Home / EndJumps to min / max.