Component

Number input

<DomNumberInput>

A labelled number field with native min / max / step support.

Playground

Try every prop live

Number input playground

Edit props in the inspector — min, max, step, and label update live.

Items per order.

Playground.vuevue
<script setup>
import { reactive } from 'vue';
import { DomNumberInput } from '@getdom/studio/vue';

const data = reactive({
	  "modelValue": 1,
	  "id": "",
	  "name": "",
	  "label": "Quantity",
	  "description": "Items per order.",
	  "placeholder": "",
	  "required": false,
	  "disabled": false,
	  "readOnly": false,
	  "invalid": false,
	  "errors": {},
	  "visible": true,
	  "validators": [],
	  "validateOnBlur": true,
	  "chrome": "field",
	  "min": 1,
	  "max": 99,
	  "step": 1
	});
</script>

<template>
	<DomNumberInput
		v-bind="data"
		@update:modelValue="data.modelValue = $event"
	/>
</template>

Demo

Live preview

Between 1 and 99.

Value: 3

Usage

Vue

<script setup>
import { DomNumberInput } from '@getdom/studio/vue';
import { ref } from 'vue';
const qty = ref(1);
</script>

<template>
  <DomNumberInput
    v-model="qty"
    label="Quantity"
    description="Between 1 and 99."
    :min="1"
    :max="99"
  />
</template>

Props

Props

NameTypeDefaultDescription
v-modelnumber0Bound numeric value.
labelstringLabel above the input.
descriptionstringHint shown below the input.
min / max / stepnumberNative numeric constraints.
disabledbooleanfalseDisable the input.