kliping.pro
  • Docs
  • Explore
  • Builder
  • Directory
  • Colors
  • Typeset
Saved
Docs
  • Sections13
  • Installation5
  • Dark Mode4
  • Forms3
  • Registry6
  • Utilities2
  • More10
  • Components137
  • Accordion
  • Action Bar
  • AI Chat
  • AI Thread List
  • Alert
  • Alert Dialog
  • Angle Slider
  • Animated Grid Pattern
  • Aspect Ratio
  • Attachment
  • Avatar
  • Avatar Group
  • Badge
  • Badge Overflow
  • Banner
  • Border Beam
  • Breadcrumb
  • Bubble
  • Button
  • Button Group
  • Calendar
  • Card
  • Carousel
  • Chart
  • Checkbox
  • Checkbox Group
  • Chip
  • Circular Progress
  • Client Only
  • Collapsible
  • Color Picker
  • Color Swatch
  • Combobox
  • Combobox Advanced
  • Command
  • Compare Slider
  • Composition
  • Context Menu
  • Cropper
  • Data Grid
  • Data Table
  • Data Table Advanced
  • Date Picker
  • Dialog
  • Direction Provider
  • Dot Pattern
  • Drawer
  • Dropdown Menu
  • Editable
  • Empty
  • Field
  • File Upload
  • Form
  • FPS
  • Gauge
  • Hitbox
  • Hover Card
  • Input
  • Input Group
  • Input OTP
  • Item
  • Kanban
  • Kbd
  • Kbd Advanced
  • Key Value
  • Label
  • List
  • Listbox
  • Logos
  • Map
  • Marker
  • Marquee
  • Mask Input
  • Masonry
  • Media Player
  • Mention
  • Menubar
  • Message
  • Message Scroller
  • Native Select
  • Navigation Menu
  • Number Field
  • Pagination
  • Particles
  • Pending
  • Phone Input
  • Pin Input
  • Popover
  • Portal
  • Presence
  • Progress
  • QR Code
  • Questionnaire
  • Radio Group
  • Range Calendar
  • Rating
  • Relative Time Card
  • Resizable
  • Responsive Dialog
  • Scroll Area
  • Scroll Spy
  • Scroller
  • Segmented Input
  • Select
  • Selection Toolbar
  • Separator
  • Sheet
  • Sidebar
  • Skeleton
  • Slider
  • Software Purchase Card
  • Sonner
  • Sortable
  • Speed Dial
  • Spinner
  • Stack
  • Stat
  • Status
  • Stepper
  • Stepper Advanced
  • Swap
  • Switch
  • Table
  • Tabs
  • Tags Input
  • Tags Input Advanced
  • Textarea
  • Time Picker
  • Timeline
  • Toast
  • Toggle
  • Toggle Group
  • Tooltip
  • Tour
  • Typography
  • Visually Hidden
  • Visually Hidden Input
  1. Docs
  2. Components
  3. Number Field

Number Field

PreviousNext

Isian angka yang memungkinkan pengguna mengetik nilai atau menaik-turunkannya lewat tombol stepper.

Docs API Reference

Installation ​

pnpm dlx kliping@latest add number-field

Pasang dependensi berikut:

pnpm add reka-ui

Salin dan tempel kode sumber di GitHub ke project Anda.

Sesuaikan path import dengan struktur project Anda.

Nonaktif ​

Decimal ​

Percentage ​

Currency ​

Form ​

Enter value between 10 and 5000.

Usage ​

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

<template>
  <NumberField :default-value="18" :min="0">
    <NumberFieldContent>
      <NumberFieldDecrement />
      <NumberFieldInput />
      <NumberFieldIncrement />
    </NumberFieldContent>
  </NumberField>
</template>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19

Requirements ​

Semua dipasang otomatis oleh kliping add; tabel ini untuk Anda yang memasang manual atau memeriksa project.

RequirementValue
ProjectVue 3.5+, Tailwind CSS v4, alias @ — disiapkan kliping init
npm packages@lucide/vue@^1.31.0, @vueuse/core@^14.4.0, reka-ui@^2.10.3
Filescomponents/ui/number-field/number-field.vue
components/ui/number-field/number-field-content.vue
components/ui/number-field/number-field-decrement.vue
components/ui/number-field/number-field-increment.vue
components/ui/number-field/number-field-input.vue
components/ui/number-field/index.ts

Anatomy ​

Susunan bagiannya seperti dipakai di contoh-contoh di atas. Impor semua bagian dari satu tempat, lalu susun begini:

vue
<NumberField>
  <NumberFieldContent>
    <NumberFieldDecrement />
    <NumberFieldInput />
    <NumberFieldIncrement />
  </NumberFieldContent>
</NumberField>

API Reference ​

NumberField ​

PropTypeDefaultDescription
defaultValue?number—The initial value when uncontrolled.
modelValue?number—The controlled value. Bind with v-model.
min?number—The smallest value allowed for the input.
max?number—The largest value allowed for the input.
step?number—The amount that the input value changes with each increment or decrement "tick".
stepSnapping?boolean—When false, prevents the value from snapping to the nearest increment of the step value
focusOnChange?boolean—When true, the input will be focused when the value changes.
formatOptions?Intl.NumberFormatOptions—Formatting options for the value displayed in the number field. This also affects what characters are allowed to be typed by the user.
locale?string—The locale to use for formatting and currencies
disabled?boolean—When true, prevents the user from interacting with the Number Field.
readonly?boolean—When true, the Number Field is read-only.
disableWheelChange?boolean—When true, prevents the value from changing on wheel scroll.
invertWheelChange?boolean—When true, inverts the direction of the wheel change.
id?string—Id of the element
asChild?boolean—Change the default rendered element for the one passed as a child, merging their props and behavior. Read our Composition guide for more details.
as?AsTag | Component—The element or component this component should render as. Can be overwritten by asChild.
name?string—The name of the field. Submitted with its owning form as part of a name/value pair.
required?boolean—When true, indicates that the user must set the value before the owning form can be submitted.
EventPayloadDescription
@update:modelValue[val: number]Emitted when the value changes.
SlotProps
#default{ modelValue: number | undefined; textValue: string; readonly: boolean; }

NumberFieldContent ​

SlotProps
#default—

NumberFieldDecrement ​

PropTypeDefaultDescription
disabled?boolean—Prevents the user from interacting with it.
asChild?boolean—Change the default rendered element for the one passed as a child, merging their props and behavior. Read our Composition guide for more details.
as?AsTag | Component—The element or component this component should render as. Can be overwritten by asChild.
SlotProps
#default—
Data attributeValue
[data-slot]"decrement"

NumberFieldIncrement ​

PropTypeDefaultDescription
disabled?boolean—Prevents the user from interacting with it.
asChild?boolean—Change the default rendered element for the one passed as a child, merging their props and behavior. Read our Composition guide for more details.
as?AsTag | Component—The element or component this component should render as. Can be overwritten by asChild.
SlotProps
#default—
Data attributeValue
[data-slot]"increment"

NumberFieldInput ​

Data attributeValue
[data-slot]"input"

Keyboard Interactions ​

Perilaku keyboard-nya datang dari primitif Reka UI NumberField yang dipakai komponen ini, mengikuti pola WAI-ARIA.

KeyDescription
Arrow UpIncrease the value
Arrow DownDecrease the value
Page UpIncrease the value by scale of 10
Page DownDecrease the value by scale of 10
HomeSet value to minimum (if min is provided)
EndSet value to maximum (if max is provided)

CSS Variables ​

Token tema yang dibaca komponen ini — ubah nilainya di CSS global (:root dan .dark, lihat Theming) untuk mengubah tampilannya tanpa menyentuh komponennya: --border, --input, --muted-foreground, --radius, --ring.

Credits ​

Berasal dari shadcn-vue (MIT, Copyright (c) 2023 unovue). Rantai lengkapnya di Credits.

PreviousNavigation MenuNext Pagination

On This Page

InstallationNonaktifDecimalPercentageCurrencyFormUsageRequirementsAnatomyAPI ReferenceNumberFieldNumberFieldContentNumberFieldDecrementNumberFieldIncrementNumberFieldInputKeyboard InteractionsCSS VariablesCredits

© 2026 Kliping. Free components are open source under the MIT License.

LicenseCreditsRoadmap