BlogPlaygroundOne

Number inputs

The VNumberInput extends the standard HTML number-type input, ensuring style consistency across browsers as a replacement for <input type="number">

Usage

Here we display a list of settings that could be applied within an application.

<v-number-input :reverse="false" controlVariant="default" label="" :hideInput="false" :inset="false" ></v-number-input>

API

ComponentDescription
v-number-inputPrimary Component
Toggle Inline API

Caveats

Guide

The v-number-input component is built upon the v-field and v-input components. It is used as a replacement for <input type="number">, accepting numeric values from the user.

Props

The v-number-input component has support for most of v-field’s props and is follows the same design patterns as other inputs.

Control-variant

The control-variant prop offers an easy way to customize steppers button layout. The following values are valid options: default, stacked, split and hidden.

Default
Stacked
Split
Hidden

Reverse

The reverse prop automatically changes the stepper buttons’ position to the opposite side for both the default and stacked control variants.

Default
Stacked
Split

Hide-input

The hide-input prop hides the input field, allowing only the stepper buttons to be visible. These stepper buttons follow a stacked control-variant layout.

Inset

The inset prop adjusts the style of the stepper buttons by reducing the size of the button dividers.

Default
Stacked
Split
Hide-input

Min/Max

The min and max props specify the minimum and maximum values accepted by v-number-input, behaving identically to the native min and max attributes for <input type="number">.

min:10/max:20

Step

The step prop behaves the same as the step attribute in the <input type="number">, it defines the incremental steps for adjusting the numeric value.

step 2; min:10; max:20
step 50, rounding on blur

Precision

The precision prop enforces strict precision. It is expected to be an integer value in range between 0 and 15. Input will prevent user from typing or pasting an invalid value.

(default precision="0")
value: 4.052
(precision="2")
value: 123
(precision="5")
value: 25.5
(precision unrestricted)
value: 0.052

Ready for more?

Continue your learning with related content selected by the Team or move between pages by using the navigation links below.