Forms
NumberField
Numeric input with stepper buttons. Values are tabular figures.
- Set
min,maxandstep; the buttons disable at the limits. - Put units in
prefix/suffix, never inside the label.
When to use
Whole or decimal numbers that people adjust in small steps: quantity, percentage, days.
Use something else
IDs, phone numbers, card numbers → TextField (they're not quantities). A rough value in a range → Slider.
Do
- Set
min,maxandstep. - Put units in
prefix/suffix(EUR, %, days), not in the label.
Don't
- Don't use it for values that are never incremented (postal codes, IDs).
Props
| Prop | Type |
|---|---|
label | string |
value | number |
defaultValue | number |
onChange | (n: number) => void; min?: number; max?: number; step?: number; prefix?: string; suffix?: string; size?: 'sm' | 'md'; description?: string; error?: string; disabled?: boolean; className?: string |
Use
const { NumberField } = window.Tessera;
const el = React.createElement(NumberField, { /* props */ });