Number Field

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>

Installation

npx shadcn@latest add @dotui/number-field

Usage

Use 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>

Playground

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>

API Reference

A number field allows a user to enter a number, and increment or decrement the value using stepper buttons.

PropType
boolean
boolean
boolean
string
string
ReactNode | function
number
number
function
NumberFormatOptions

Last updated on 1/13/2026

Built with passion by @mehdibha.