Input Number

Numeric input with increment/decrement buttons. Use for quantities and bounded numbers. For unstyled number entry, use Input type="number".

Default

Bound with v-model. Use min, max, decimal to constrain.

Dark previewReplay previewOpen in new tab

Usage

Import the parts you need from the component's folder.

ts
import { InputNumber } from "@/components/ui/input-number";

With bounds

min, max, and decimal constraints.

Dark previewReplay previewOpen in new tab

Decimal

Pass decimal to allow a fractional part.

Dark previewReplay previewOpen in new tab

API Reference

InputNumber

PropTypeDefaultDescription
modelValuenumber | stringnullCurrent value. Supports v-model. Displayed thousand-separated.
placeholderstring""Placeholder text.
minnumber—Minimum value. Negative input is blocked unless min < 0.
maxnumber—Maximum value.
decimalbooleanfalseAllow a decimal part.
classstring | object | array""Extra classes.
EventDescription
update:modelValueFires with the parsed number. Enables v-model.