Stepper

Plus and minus quantity control whose number slides in the direction you change it. Hold to repeat faster, with an optional fill showing how close you are to the limit.

Preview

Props Changes apply to the live preview above.

Installation

npx @lumioui/cli add stepper

Usage

import { Stepper } from "@/components/ui/stepper/stepper";
<Stepper />

Examples

Compact

A print sheet, the compact segment pair's natural home.

Quantity

A grocery basket in orange.

API reference

Prop Type Default
value number

Controlled value. Omit + use defaultValue for uncontrolled.

—
defaultValue number

Uncontrolled initial value. Default 0.

0
onValueChange (value: number) => void —
min number Number.MIN_SAFE_INTEGER
max number Number.MAX_SAFE_INTEGER
step number 1
disabled boolean —
className string —
showValue boolean

Show the value in the center. Default true. Set false for a compact segment pair (just -/+).

true
repeat boolean

Press-and-hold to repeat. Default true.

true
meter boolean

Light follows the value: a dim accent fill behind the count, sized to how far the value sits between min and max. At max the fill meets the edge, brightens and the edge lights; a further + flickers that edge. Needs finite bounds and the value pill (showValue). Default false.

false