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

PropTypeDefaultDescription
valuenumberControlled value
defaultValuenumber0Default value (uncontrolled)
minnumber-InfinityMinimum allowed value
maxnumberInfinityMaximum allowed value
stepnumber1Increment/decrement step
labelstringLabel text displayed above the input
errorstringError message to display
hideControlsbooleanfalseHide increment/decrement buttons
onValueChange(value: number) => voidHandler called when value changes
disabledbooleanfalseWhether the input is disabled

Related Components