Number input
A number field (Mantine's NumberInput): + and − buttons (hold to repeat), arrow keys, min, max and step, fixed decimals, a prefix and a suffix, a thousands separator, or a duration (m:ss). An ARIA spinbutton.
- Subtotal
- Discount
- Total
Arrows step, Shift+arrows ×10, hold + or − to repeat.
API
For AI agents: this API as Markdown, or every component in llms-full.txt.
<ray-number-input> · RayNumberInput
Arrow Up/Down step (Shift: ×10), Page Up/Down ×10, Home/End go to min/max. The value is a number (undefined when empty); the form gets its plain digits; min and max are checked (rangeUnderflow, rangeOverflow). Enter submits its form, as in ray-input.
| Property | Attribute | Type | Default | Description |
|---|---|---|---|---|
value | value | number | The number (undefined when empty). | |
min | min | number | Minimum. | |
max | max | number | Maximum. | |
step | step | number | 1 | What + and − add. |
decimals | decimals | number | Fixed decimals (2: 3 shows as 3.00). | |
prefix | prefix | string | Shown before the number ("$"), beside the editable text: the field holds the digits only. Still in aria-valuetext and in the min/max messages. | |
suffix | suffix | string | Shown after the number (" kg", "%"), hugging it on the other side of the caret: the field holds the digits only. | |
thousandsSeparator | thousands-separator | string | Groups thousands in the shown text (",", ".", " "). | |
decimalSeparator | decimal-separator | string | . | The decimal mark shown and typed ("," in many locales). |
clamp | clamp | blur | strict | none | blur | When out-of-range input is clamped: on blur, while typing, or never (then it is invalid). |
format | format reflects | number | duration | number | duration: the value is seconds, shown and typed as m:ss (h:mm:ss when min or max reaches an hour; a plain number is seconds); aria-valuetext says "3 minutes, 15 seconds" in the page's language. decimals, prefix, suffix and the separators do not apply. |
hideControls | hide-controls reflects | boolean | No + and − buttons (the keys still step). | |
placeholder | placeholder | string | Shown while empty. | |
readonly | readonly reflects | boolean | Not editable, still submitted. |
| Event | Description |
|---|---|
input | On every change of the value (typing, keys, buttons). |
change | When the value is committed (blur, a step). |
| Slot | Description |
|---|---|
left | Left section (an icon). |
right | Right section. |
| Part | Description |
|---|---|
input | The text field. |
prefix | The prefix beside the text field. |
suffix | The suffix beside the text field. |
controls | The + and − column. |
increment | The + button. |
decrement | The − button. |
Texts
What it writes itself, in English; setStrings() translates them (Getting started: Languages).
| Key | English |
|---|---|
number-input.increment | Increment |
number-input.decrement | Decrement |
number-input.required | Please enter a number. |
number-input.min | The minimum is {min}. |
number-input.max | The maximum is {max}. |