Slider

Slider with an optional value bubble and tick marks for stepped values. The fill brightens while you drag, and it can give a brief flicker when you push past either end.

Preview

Props Changes apply to the live preview above.

Installation

npx @lumioui/cli add slider

Usage

import { Slider } from "@/components/ui/slider/slider";
<Slider />

Examples

Dimmer

A pendant dimmer over the room it lights.

Glass

A glass lane + disc scrubber over album artwork.

Price

Max-nightly-price filter.

Ticks

A "Text size" setting: seven stepped detents with tick marks, a small and large A as end caps, and the preview text resizing live.

API reference

Prop Type Default
value number

Controlled value. Omit + use defaultValue for uncontrolled.

—
defaultValue number

Uncontrolled initial value. Default min.

—
onValueChange (value: number) => void —
onSlidingComplete (value: number) => void

Fires once when the finger lifts, with the settled value.

—
min number 0
max number 100
step number 1
disabled boolean —
className string —
showTicks boolean

Show tick marks for each step. Default false.

false
glass boolean

Glass track + thumb — a frosted lane with a glass disc.

false
showValue boolean

A value bubble that rises over the thumb while it is held and swaps its number in place per step. Default false.

false
formatValue (value: number) => string

Formats the bubble's number. Default String(value).

—
flickerAtEnds boolean

Overdragging past min or max flickers the thumb once into the end it hit, with a warning haptic ("can't"). Default false.

false