# Shadcn Default Size

> Basic number field

- Type: example, free and open source (MIT)
- Component: [Number Field](https://reui.io/components/number-field.md)
- Page: https://reui.io/components/number-field/c-number-field-1
- Docs (Base UI): https://reui.io/docs/components/base/number-field.md
- Docs (Radix UI): https://reui.io/docs/components/radix/number-field.md
- MCP: `get_example("c-number-field-1")`
- Registry item: https://reui.io/r/styles/base-nova/c-number-field-1.json
- Uses: Number Field

## Best for

The default size with minus at the start, plus at the end and the value centered between them

## When not to use

- A value checked against a schema with an error shown under the control: use [Form Validation](https://reui.io/components/number-field/c-number-field-6.md) (`get_example("c-number-field-6")`)

## Install

```bash
npx shadcn@latest add @reui/c-number-field-1
```

## About Shadcn Number Field

### When to use

- Quantities, amounts and counts stepped up or down by buttons inside a min and max range
- Compact numeric settings whose label scrubs the value when dragged sideways
- Validated amounts in a React Hook Form form, checked by a zod schema with the error shown below

### When not to use

- Free text such as a name, an email or an order ID, with nothing to step: use [Input](https://reui.io/components/input.md) (`get_component("input")`)
- A full plans comparison with tier prices and a seat count to adjust: use the [Pricing blocks](https://reui.io/blocks/marketing/pricing.md)
- A record entry page with many controls, such as a product with price and stock: use the [Form blocks](https://reui.io/blocks/application/form.md)

### Agent notes

- `onValueChange` receives null when the input is cleared, so type a controlled `value` as a number or null
- Set `aria-invalid` on `NumberFieldGroup` to turn its border destructive; a shadcn `Field` marked invalid only recolors text
- An outside label must point `htmlFor` at the `id` passed to `NumberField`, which Base UI sets on the input

Every ReUI item has a twin like this one; the index is https://reui.io/llms.txt. Agents with the ReUI MCP (https://reui.io/docs/mcp) get the same guidance from the getters named above.
