Numeric input

Takes a number, with steppers for small adjustments such as thresholds.

Refined portVue source: WildNumericInput.vueStorybook story: Forms/Numeric Input

Try it

Press the steppers, or tab to one and press Enter.

240
Steppers
Error
Disabled
<WildTextInput
  v-model="threshold"
  size="lg"
  type="quantity"
/>

When to use

  • Use it for a whole number people adjust in small steps, such as an alarm threshold.
Don’t use it

Anatomy

A 44px field with a decrease and an increase stepper inside the frame.

240
lg · 44
<WildTextInput v-model="threshold" type="quantity" size="lg" />
It’s always 44px tall, because the 34px steppers don’t fit the 36px frame.

States

The same five states as the text input.

rest
240
hover
240
focus
240
error
240
disabled
240

Accessibility

The steppers are buttons named Decrease and Increase. When the field is disabled, so are they.

KeyWhat it does
TabMoves to the decrease stepper, then the increase stepper.
Enter / SpaceSteps the number down or up.

Props

PropTypeDefaultDescription
modelValuenumber—The number.
type'quantity'—Adds the steppers.
size'lg''lg'Always 44px; the steppers need it.
errorboolean | stringfalseRed border; a string also shows the message.
disabledbooleanfalseGreys the field and disables the steppers.

Tokens

TokenValueWhere it lands
--radius-field10pxThe frame.
--radius-lg8pxThe steppers.
(no token)34pxStepper size.
--global-blue-1000#1877F2Border on focus, 2px.
(no token)15pxThe number.
--color-grey-800#7F7D83Stepper icon at rest.
--color-grey-1000#2D2B32Stepper icon on hover.