TL;DR
Use an InputNumber for an editable quantity with meaningful increments; use a range slider for a bounded setting where the exact figure is secondary. Use a money field when currency presentation and decimal handling matter, and use text for identifiers that merely contain digits. In a generated Vue form, choose the control from field meaning as well as schema type, then enforce the same value contract on the server.
A form generator can tell that seats is numeric without knowing whether people need to type an exact seat count, drag a setting, or enter a price. That distinction determines the control. I would evaluate each field against four questions: What value does the API expect? Must the person enter an exact value? Are there range or increment rules? Does the display need currency, units, or preserved leading zeroes?
This is a comparison for teams building generated Vue forms, not a prop-by-prop InputNumber reference. If you already know you need a quantity control, our DOM Studio Number Input playground is the direct place to inspect its configuration. If you are still deciding, start with the field’s semantics.
Table of contents
- InputNumber versus range, money, and text: the decision table
- 1. Choose InputNumber for exact, editable quantities
- 2. Choose a range when adjusting a bounded setting
- 3. Choose a money field for monetary meaning, not merely decimals
- 4. Keep identifiers as text even when every character is a digit
- Turn field meaning into a generated-form contract
- Validate the choice before rolling it into every form
- Frequently asked questions
- Make the control choice once, then test it in context
- Sources
- Recommended Reads
InputNumber versus range, money, and text: the decision table
| Field meaning | Best starting control | Canonical value | Main trade-off |
|---|---|---|---|
| Exact quantity, such as seats or items | Editable InputNumber | Integer or number, after validation | Stepping is useful, but raw partial and invalid entries still need a policy. |
| Approximate bounded selection, such as volume or confidence | Range slider | Number within declared bounds | Quick to adjust, less suited to entering an exact figure. |
| Price, budget, or other monetary amount | Money input with an application-owned parser | Canonical decimal string or minor units, as your API specifies | Currency display is not the same as exact arithmetic or locale parsing. |
| Numeric-looking identifier, such as a postal or account code | Text input | String | You own format checks, but you preserve leading zeroes and avoid inappropriate stepping. |
A percentage is not automatically a slider: an exact tax rate may call for numeric entry, while a rough confidence setting may suit a range. A measurement also depends on the workflow. Entering precisely 1.25 hours is different from adjusting an approximate intensity setting. The browser’s number control is intended for incremental numeric values, while a range control is intended for choices where precision is not central. See MDN’s number input and range input references.

1. Choose InputNumber for exact, editable quantities
An InputNumber is a good default when the person can state a specific numeric answer and an increment or decrement action makes sense. Think order quantities, employee seats, a whole-number percentage, or a measurement with a declared unit and increment. DOM Studio’s Number Input reference exposes label, description, min, max, step, required and error state for this kind of field.
Set boundaries from the domain, not the available screen width. If a quantity runs from 1 to 99, show that range in the description and check typed, pasted, and stepped values. Native min and max participate in constraint validation; they do not stop every out-of-range value from being typed. step describes valid increments relative to the step base, usually min when it is present. For number inputs, the default step is 1, so a fractional measurement needs an explicit rule. These are browser behaviors, not a complete business validator. MDN documents number-input constraints and manual entry.
Keep blank distinct from zero. DOM Studio’s current Number Input guide says its model is a number while filled and an empty string when cleared. Your adapter should translate that cleared state according to the field contract, perhaps to null for an optional field or a required-field error on submit. Do not turn an empty value into 0 just to satisfy a numeric type. DOM Studio documents its filled and cleared model values.
For a quick illustration of native number entry before considering component wrappers, this independent HTML tutorial is a useful starting point:
2. Choose a range when adjusting a bounded setting
A slider is for selecting a position on a known scale, not for making someone aim at an exact number of seats. If the value’s relationship to its minimum and maximum matters more than the exact digits, a range can reduce friction. Examples include an approximate confidence score or an adjustable intensity. If users must enter 37 precisely, make numeric entry available instead of forcing careful dragging. MDN distinguishes the range control’s approximate selection from exact number entry.
DOM Studio’s Range Input documents min, max, step, an optional unit suffix, and a visible-value option. Treat that display as part of the choice: users should understand the scale, the current selection, and the unit. A slider without a meaningful lower and upper bound is a poor fit. An initially blank answer also needs consideration, because a slider commonly presents a selected position rather than a truly empty field.

Check keyboard adjustment, readable labels, and touch use in the implementation you ship. The W3C slider pattern calls for a programmatically exposed value and bounds, and specifically cautions that custom sliders need testing with touch-based assistive technology. Prefer existing native behavior where it meets the interaction requirement; a visual track alone is not accessibility support.
3. Choose a money field for monetary meaning, not merely decimals
A price is not just a number with two decimal places. People need to know the currency and possibly a billing or measurement unit; your API needs a deliberate representation and rounding policy. DOM Studio’s Money Input supplies currency-symbol chrome using currency and locale, along with prefix, suffix, min, max, and step options. Its documentation explicitly leaves decimal transformation and calculations to the form or backend layer. Do not assume the symbol display automatically parses every localized amount or guarantees precise monetary arithmetic.
There is another legitimate implementation style. PrimeVue’s InputNumber documentation describes a single component with decimal and currency modes, locale-specific grouping and decimal symbols, fraction-digit controls, boundaries, and optional stepper buttons. If you want one component API for several formatted numeric entries, that approach is worth evaluating. If you need a separate money-specific field and explicit application ownership of amount transformation, DOM Studio’s split between Number Input and Money Input may be clearer. Neither UI approach removes the need to specify accepted locale input, canonical submission, and server-side monetary rules.
For example, an invoice unit price might appear with a GBP symbol while your API expects a decimal string such as "149.00". Keep that serialization policy outside the visual prefix. Test empty and in-progress entries before committing an amount, and do not infer an application’s payment, tax, or billing behavior from a currency control.
4. Keep identifiers as text even when every character is a digit
Postal codes, account numbers, and similar identifiers are labels, not quantities. Adding one to a postal code is nonsensical; dropping an initial zero changes its identity. MDN specifically advises against a number input for digit-only values that are not really numbers. Use a text control, then define the accepted length, characters, and normalization for the actual identifier. MDN explains the distinction between numeric values and numeric-looking codes.
For a digits-only identifier, a text input can request a numeric mobile keyboard with inputmode="numeric"; that hint does not validate the value or reject pasted letters. Some identifiers also include letters or punctuation, in which case even a numeric keyboard hint can be counterproductive. DOM Studio’s Text Input reference provides the general text control and field-label options; your application must supply the identifier’s format rule. MDN describes inputmode as a keyboard hint rather than validation.
Turn field meaning into a generated-form contract
A schema should define the accepted data before the renderer chooses its widget. For each field, I would record its canonical type, required policy, bounds if applicable, allowed increment, units or currency, display locale, and the meaning of blank. Presentation metadata then selects one of a small, reviewed set of controls. The distinction keeps a server-provided field definition from becoming permission to render an arbitrary component.
| Example field | Data rule | Presentation decision | Submission rule |
|---|---|---|---|
seats |
Whole number, 1 to 99, required | InputNumber with step 1 and range guidance | Submit a validated integer. |
confidence |
Number, 0 to 100 | Range with an explicit percent label and current value | Submit a validated number. |
unitPrice |
Amount in GBP with product-specific precision | Money field with currency context | Submit the API’s agreed decimal representation. |
postalCode |
String with country-specific format | Text, with an appropriate keyboard hint if useful | Preserve its leading zeroes. |
For teams using JSON Schema, integer and number express numeric types, minimum and maximum express inclusive bounds, and multipleOf can constrain multiples. An object’s required array names required properties. Those keywords describe valid data, not whether your UI should be a slider, stepper, or money field. See the JSON Schema numeric reference and required-property guidance.
One subtlety matters when mapping schemas to native inputs: JSON Schema multipleOf: 0.25 means multiples of 0.25 from zero, whereas native step="0.25" can use min as its base. A field with minimum 0.1 does not get the same permitted set from those two rules. Decide whether the domain rule is multiples of an absolute unit or increments from the lower bound, and make the validator and UI agree. This follows from the JSON Schema definition of multipleOf and MDN’s explanation of the step base.
DOM Studio’s Form reference shows named fields reporting values and errors to DomForm, plus schema adapters that generate field records. Use an explicit field-to-control mapping in that layer. Do not assume type: number conveys intent to render a particular UI, and do not put a live error into a reusable schema definition. A quantity, an approximate setting, and a currency amount can each have different rendering and serialization rules even if all involve numeric values.
Validate the choice before rolling it into every form
Run a short acceptance pass for each selected control:
- Empty and partial: Clear an optional field, clear a required field, and try an in-progress decimal such as
12.. Check when errors appear and whether unfinished input is preserved. - Bounds and step: Test the minimum, maximum, just-outside values, and a manually entered or pasted off-step value. Do not assume disabled spinner arrows prevent invalid text. MDN documents how entered values can fail number-input constraints.
- Formatting: Enter and paste supported currency formats, verify the display after blur, and check the exact payload sent to the API. Repeat for every locale you claim to support.
- Interaction: Try keyboard, pointer, mobile input, screen reader, and a correction after a server rejection. For a slider, test touch assistive technology rather than assuming pointer success is enough. W3C details slider interaction and testing concerns.
Client constraints help people complete a form; they are not an authorization or security boundary. Validate the canonical value against the same domain rules on the server. MDN explicitly warns against relying on client-side number validation for security. For a fuller execution matrix, use our companion article linked under Recommended Reads.
Frequently asked questions
Does step stop people typing an off-step number?
No. A person can manually enter a value that fails the configured step rule; the field then needs a useful validation response. Keep the server’s rule aligned with the actual permitted values, particularly if min changes the native step base. MDN’s number-input reference covers these cases.
Should a percentage always use a range slider?
No. Ask whether exact entry matters. A precise 17.5% value needs an editable field and an appropriate increment rule. A rough 0–100% preference can suit a slider if users can understand and adjust its selected value. MDN’s range guidance explains the precision distinction.
Can a currency prefix replace a money-specific value contract?
No. A symbol establishes display context, not a parsing rule, precision guarantee, or backend representation. DOM Studio’s Money Input documentation assigns decimal transformation to the application or backend; decide and test that contract separately.
Make the control choice once, then test it in context
I would start with one representative field from each category, document its canonical value and invalid states, and test the generated form beside its API. Then explore the Number Input, Range Input, Money Input, and Text Input references for the controls that actually fit your fields. A reusable decision rule is more valuable than forcing every number-shaped field into the same widget.
Sources
- MDN: number input
- MDN: range input
- MDN: inputmode attribute
- W3C WAI: Slider Pattern
- JSON Schema: Numeric types
- JSON Schema: Object required properties
- PrimeVue: InputNumber
- DOM Studio: Number Input
- DOM Studio: Range Input
- DOM Studio: Money Input
- DOM Studio: Text Input
- DOM Studio: Form reference
