# Shadcn Buttons on Right

> Number field with buttons on right

- 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-4
- 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-4")`
- Registry item: https://reui.io/r/styles/base-nova/c-number-field-4.json
- Uses: Number Field

## Best for

The value aligned left with minus and plus grouped side by side at the end of the field

## When not to use

- Stacked up and down chevrons in place of a minus and plus pair: use [Spinner Buttons](https://reui.io/components/number-field/c-number-field-5.md) (`get_example("c-number-field-5")`)

## Install

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

## 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.
