Slider
An inline field slider: a labelled squircle row with a thin handle and the live value, matching Input's corner radius and smoothing. Drag, click, or use the arrow keys. Comes in plain, dotted, and dual-handle range variants, plus a classical capsule-and-knob layout for when the field style isn't the fit; responsive and theme-aware.
Installation
npx stepwise-ui add slider
Default
Dots
Tick marks split the track into steps. Each dot fades out as the fill passes it, so the handle reads its position at a glance - good for discrete, low-count settings.
Range
Two handles select a span; the fill sits between them and the handles can't cross.onChangereturns a [start, end] tuple.
Classical
Compact pill track, solid zinc fill, white knob inset equally on all four sides with a light shadow - no ring, no gradient. classical is orthogonal to variant: plain is continuous, dots adds fixed-interval ticks, range adds a second handle. Label and value sit above the track. Dots swap color instead of fading here - the capsule track is too compact for the fade to read.
Showcase
Custom value formatting via formatValue.
Props
PropTypeDescription
variant"plain" | "dots" | "range"Track style. Default "plain".
classicalbooleanCompact pill-track layout instead of the field style. Default false.
orientation"horizontal" | "vertical"Classical track only. Default horizontal.
valuenumber | [number, number]Controlled value (tuple for range).
defaultValuenumber | [number, number]Uncontrolled initial value.
onChange(v: number | [number, number]) => voidFires on drag / key / click.
minnumberMinimum. Default 0.
maxnumberMaximum. Default 100.
stepnumberSnap increment. Default 1.
labelstringLabel shown inside, on the left.
showValuebooleanShow the value on the right. Default true.
formatValue(v: number) => stringFormat the displayed value.
dotCountnumberTick marks for the dots variant. Default 5.
disabledbooleanDisables interaction.