A number field allows a user to enter a number value with a keyboard or increment/decrement with step buttons.
<NumberField defaultValue={1024}>
<Label>Width</Label>
<Group>
<Button slot="decrement" />
<Input />
<Button slot="increment" />
</Group>
</NumberField>npx shadcn@latest add @dotui/number-fieldUse NumberField to allow users to enter a numeric value with keyboard or increment/decrement buttons.
import { NumberField } from "@/components/ui/number-field";
import { Input } from "@/components/ui/input";
import { Label } from "@/components/ui/field";<NumberField>
<Label>Quantity</Label>
<Input />
</NumberField>Use the controls below to experiment with different number field props and see the live preview and code update.
<NumberField defaultValue={1}>
<Label>Quantity</Label>
<Input />
</NumberField>A number field allows a user to enter a number, and increment or decrement the value using stepper buttons.
| Prop | Type | Default | |
|---|---|---|---|
boolean | — | ||
boolean | — | ||
boolean | — | ||
string | — | ||
string | — | ||
ReactNode | function | — | ||
number | — | ||
number | — | ||
function | — | ||
NumberFormatOptions | — | ||
Last updated on 1/13/2026
Bringing singularity to the web.
Built with passion by @mehdibha.