Skip to content
navy

NumberInput

Numeric input components with min/max constraints and optional step controls. Available in three variants.

Live Demo

Basic (No Controls)

Value: 10

Vertical Controls

Value: 5

Horizontal Controls

Value: 1

Decimal Values

Value: 9.99

Variants

ComponentDescription
orio-number-inputBasic number input without controls
orio-number-input-verticalControls stacked vertically on the right
orio-number-input-horizontalMinus/plus controls on left and right sides

Usage

Basic

vue
<template>
  <orio-number-input v-model="value" :min="0" :max="100" />
</template>

<script setup>
const value = ref(0)
</script>

Vertical Controls

vue
<orio-number-input-vertical
  v-model="quantity"
  :min="1"
  :max="99"
  :step="1"
  label="Quantity"
/>

Horizontal Controls

vue
<orio-number-input-horizontal
  v-model="count"
  :min="0"
  :max="10"
  :step="1"
  label="Count"
/>

Decimal Values

vue
<orio-number-input-horizontal
  v-model="price"
  :min="0"
  :max="1000"
  :step="0.01"
  :decimal-places="2"
  label="Price"
/>

Features

  • Boundary validation - Values are clamped to min/max range on blur
  • Increment/Decrement buttons - Click to adjust value by step amount (Vertical & Horizontal)
  • Press and hold - Hold button to continuously adjust after 500ms delay (Vertical & Horizontal)
  • Decimal precision - Control decimal places with decimalPlaces prop

Props

PropTypeDefaultDescription
modelValuenumber0Input value (v-model)
minnumberundefinedMinimum allowed value
maxnumberundefinedMaximum allowed value
stepnumber1Amount to increment/decrement per step
decimalPlacesnumber0Number of decimal places to display
labelstringundefinedLabel text displayed above input
placeholderstringundefinedPlaceholder text

All standard HTML input attributes are supported via v-bind="$attrs".

Events

EventPayloadDescription
update:modelValuenumberEmitted when input value changes

Styling

css
--color-bg           /* Input background */
--color-border       /* Border color */
--color-text         /* Text color */
--color-accent       /* Focus border color */