Skip to content
VenusUI
Get started

Number Stepper

A number field with minus and plus buttons, clamped to a range.

Preview

Installation

npx shadcn@latest add @venusui/number-stepper

Run this in a project set up with shadcn. If you haven’t set it up yet, run npx shadcn@latest init first.

Files added to your project

Paths use the default shadcn aliases. The CLI follows the aliases in your components.json.

  • @/components/ui/number-stepper.tsx

Usage

The code behind the preview above.

number-stepper-demo.tsx

import { NumberStepper } from "@/components/ui/number-stepper"

export default function NumberStepperDemo() {
  return <NumberStepper label="Seats" defaultValue={3} min={1} max={20} />
}

API reference

PropTypeDefaultDescription
labelstring—Visible label. Required.
valuenumber—Controlled value.
defaultValuenumber0Initial value.
onValueChange(value: number) => void—Called with the clamped value.
minnumber0Lowest value.
maxnumber99Highest value.
stepnumber1Amount per click.

Only the props above, plus className.

Requirements

  • lucide-react, React 19 and Tailwind CSS v4.

Customization

  • Widen the field (w-14) for larger numbers.

Accessibility

  • A native number input with a label; the buttons are named “Increase Seats” / “Decrease Seats” and disable at the limits.

Troubleshooting

Typing a number outside the range.
Values are clamped to min/max as you type.
Unknown registry "@venusui"
Your shadcn CLI couldn’t find the namespace in the shadcn registry index. Use the latest CLI (npx shadcn@latest), install by URL, or register it with its address: npx shadcn@latest registry add @venusui=https://venusui.com/r/{name}.json.
No components.json found
Run npx shadcn@latest init in your project first.
Loading preview

A text field whose label sits inside and floats above on focus or when filled.

Loading preview

OTP Input

Inputs

One-time code entry in separate boxes with paste, autofill and keyboard navigation.

Loading preview

A lock-screen passcode keypad that shakes on a wrong code and unlocks on the right one.