Number Field

A number field allows a user to enter a number and increment or decrement the value using stepper buttons.

Installation

bash
npx shadcn-vue@latest add number-field

Usage

vue
<script setup lang="ts">
import { Label } from '@/components/ui/label'
import {
  NumberField,
  NumberFieldContent,
  NumberFieldDecrement,
  NumberFieldIncrement,
  NumberFieldInput,
} from '@/components/ui/number-field'
</script>

<template>
  <NumberField>
    <Label>Age</Label>
    <NumberFieldContent>
      <NumberFieldDecrement />
      <NumberFieldInput />
      <NumberFieldIncrement />
    </NumberFieldContent>
  </NumberField>
</template>

Examples

Default

Disabled

Decimal

Percentage

Currency

Form

Enter value between 10 and 5000.

Edit this page on GitHub