Number Field
A numeric input with a stepper, locale formatting, and an optional scrub handle.
Loading documentation…
Use NumberField wherever an <input type="number"> would go and you care
about the result. It formats with Intl.NumberFormat, clamps to min and
max, steps with ↑ and ↓ (×10 with Shift, ÷10 with Alt), and never lets a
stray scroll silently change the value unless you ask for allowWheelScrub.
suffix is a flush addon on the right edge — the unit belongs to the control,
not to the label, so it stays visible while the value changes.
scrubbable adds a grip on the left edge that you drag sideways to sweep the
value. It is the only comfortable way to dial a number in while watching
something else update, and it costs one 20px handle.
format takes Intl.NumberFormatOptions, so currency, percentages and
grouping are configuration rather than code.
Controlled and uncontrolled value.
Fires on every committed change.
Bounds. The value is clamped to them.
The increment for the stepper and the arrow keys.
The Shift and Alt increments. They default to ten times and a tenth of
step.
Currency, percent, grouping, fraction digits.
The locale used for formatting and parsing.
Lets the mouse wheel change the value while the field is focused. It
defaults to false, on purpose.
Adds the drag handle on the left edge. It defaults to false.
A flush addon on the right edge — req/s, GB, %.
Control height. It defaults to base.
The same field layout every heyo-ui control composes. See
Field.
Standard form behaviour, passed through to Base UI.