---
type: doc
title: Number Field
description: A number input with decrement and increment buttons.
---

> Fulldev UI React extension for an official shadcn/ui project. The `@fulldev` registry in `components.json` points at `https://ui.full.dev/r/react/styles/{style}/{name}.json`; see [installation](/react/docs/installation.md).

```tsx title="Usage of @fulldev/number-field (react/gallery/ui/number-field.tsx, not installed)"
import { Label } from "@/components/ui/label"
import {
  NumberField,
  NumberFieldDecrement,
  NumberFieldIncrement,
  NumberFieldInput,
} from "@/components/ui/number-field"

export default function Demo() {
  return (
    <div className="flex flex-col gap-10 p-6">
      <div className="flex flex-col gap-2">
        <Label htmlFor="quantity">Quantity</Label>
        <NumberField id="quantity" name="quantity" defaultValue={1} min={1}>
          <NumberFieldDecrement aria-label="Decrease quantity" />
          <NumberFieldInput />
          <NumberFieldIncrement aria-label="Increase quantity" />
        </NumberField>
      </div>
    </div>
  )
}
```

## Installation

```bash
npx shadcn@latest add @fulldev/number-field
```

## Usage

```tsx
import {
  NumberField,
  NumberFieldDecrement,
  NumberFieldIncrement,
  NumberFieldInput,
} from "@/components/ui/number-field"
```

```tsx
<NumberField name="quantity" defaultValue={1} min={1}>
  <NumberFieldDecrement />
  <NumberFieldInput aria-label="Quantity" />
  <NumberFieldIncrement />
</NumberField>
```

`NumberField` is the Base UI
[Number Field](https://base-ui.com/react/components/number-field) in the
shadcn/ui input group look. Set `name`, `defaultValue` or `value`, `min`, `max`,
`step` and `format` on `NumberField`. The buttons are named "Decrease" and
"Increase"; pass an `aria-label` in your language.

## API Reference

Source: [`react/src/components/ui/number-field.tsx`](https://github.com/fulldotdev/ui/blob/main/react/src/components/ui/number-field.tsx)

## Install what this page shows

```bash
npx shadcn@latest add @fulldev/number-field
```
