Skip to content

Forms

INumberInput ​

A numeric field whose model is a string rather than a number, so a value never passes through a JavaScript float on its way to your API.

Keep the value a string end to end and do the arithmetic with the decimal helpers, a decimal library, or on the server.

Precision ​

precision fixes the number of decimal places, so 1240 shows and submits as 1240.00.

Bounds and step ​

min, max and step are strings too, for the same reason the model is.

Without the stepper ​

The stepper buttons are on by default. Drop them where the value is typed rather than nudged.

Locale ​

locale decides how the value is displayed and which decimal separator is accepted while typing. The model stays a plain machine-readable string.

vue
<INumberInput v-model="amount" :precision="2" locale="de-DE" />

Sizes ​

Props ​

PropTypeDefaultDescription
min / maxstring—Bounds, as strings
stepstring'1'Stepper increment
precisionnumber—Fixed decimal places
localestring—Display and separator handling
stepperbooleantrueShows the increment/decrement buttons
size'sm' | 'md' | 'lg''md'Control scale
placeholderstring—Placeholder text
disabledbooleanfalseDisables the field
requiredbooleanfalseMarks it required
invalidboolean—Error styling; set automatically inside IFormField
idstringgeneratedUseful when an external ILabel targets it
incrementLabelstring'Increment'Accessible name for the up button
decrementLabelstring'Decrement'Accessible name for the down button
unstyledboolean—Drop built-in classes
classstring—Merged with the built-in classes
ui{ root?, input?, stepper?, step? }—Per-element class overrides

Sizing it ​

class lands on the root, the box the whole control occupies — size the field there, and reach the <input> itself with ui.input.

vue
<INumberInput v-model="amount" class="max-w-xs" />

Attributes go to the input, so with no visible label put aria-label on the component.