Number Field
Live example
Number Field
Installation
npx shadcn@latest add https://hextech-ui.vercel.app/r/number-field.jsonAPI reference
These are the main Number Field options. See the exported TypeScript types for inherited native or primitive props.
| Prop | Type | Default |
|---|---|---|
label | string (required) | — |
value / defaultValue | number | null | — |
min / max / step | number | Base UI defaults |
Numeric state
Use value and onValueChange for controlled editing, or defaultValue for local state. Set bounds with min and max and choose step for increment buttons. Native form submission uses name. The visible label remains 8px above the control.