InputNumber
A number field with buttons to step the value up and down.
credits
<template> <InputNumber v-model="state.trigger" :min="1" :step="50" class="w-32" /></template>Props
| Name | Type | Default |
|---|---|---|
| size | "md" | "sm" | "md" |
| min | number | - (unbounded) |
| max | number | - (unbounded) |
| step | number | 1 (UInputNumber's own default) |
| ...props | UInputNumber props (modelValue, increment, decrement, disabled, ...) | - |
Guidelines
Do
- Set
min/max/stepto match the real constraint (e.g. a credit threshold that only makes sense in multiples of 50 or 100) - the stepper buttons respect them directly. - Pair with a trailing unit label (e.g. "credits") as a sibling element, not inside the field itself - see the billing auto-topup settings for the pattern.
Don't
- Don't use this for a value that isn't a real number a user increments/decrements - a plain
Inputwithtype="number"(no stepper chrome) fits a one-off numeric field better, e.g. a percentage typed directly. - Don't disable both
incrementanddecrementjust to get a plain numeric text field - reach forInputinstead in that case.