Number Input

Forms

A numeric input with increment and decrement controls. Use for quantity selectors, counters, or any numeric input with bounded values.

Import

import { NumberInput } from "@/components/ui/number-input";

Usage

Quantity Selector

Common use case for product quantities

With Step

Number input with custom step increment

Without Controls

Just the numeric input without buttons

Disabled

Number input in disabled state

API Reference

value
number

Controlled value

defaultValue0
number

Default value (uncontrolled)

min-Infinity
number

Minimum allowed value

maxInfinity
number

Maximum allowed value

step1
number

Increment/decrement step

label
string

Label text displayed above the input

error
string

Error message to display

hideControlsfalse
boolean

Hide increment/decrement buttons

onValueChange
(value: number) => void

Handler called when value changes

disabledfalse
boolean

Whether the input is disabled