Number Input
The catnip-input-number custom element is a single numeric field with decrement and increment controls, optional digit grouping, and the same integrated label and supporting-text patterns as Input and Chip Input. Shared field behaviour is summarised on Inputs overview.
Overview
- Value (
v-model):model-value/.modelValueisnumber | null. An empty field emitsnull(placeholder such as"0"is display-only). - Steppers: Trailing − / + buttons adjust the value by
step(default1), respectingmin/maxwhen set. - Keyboard: Arrow Up / Arrow Down step while the control is focused.
- Digit grouping: Set
separate-at(e.g.3) andseparator(,**, **.**, or space) to format the integer part for display (e.g. **1,234,567`). The canonical value stays unformatted. - Forms: Submitted values are raw numbers without grouping separators.
Live example
Accessibility
- Label: Use the
labelprop orlabelslot;for/idwiring is handled automatically. - Steppers: Accessible names from bundled locale keys (
inputNumber.decrement,inputNumber.increment). - Invalid state:
intent="danger"setsaria-invalid="true"on the control;aria-describedbyincludes supporting text when present.