GhostNumberInput reference
Package: @ghostvue/vue. Status: experimental (stability policy).
Headless locale-aware spinbutton with numeric v-model, min/max/step clamping, and increment and decrement buttons. useGhostNumberInput owns parsing and formatting; GhostNumberInput composes the control layout.
Generated from the component manifest. Edit the manifest or Vue source, then rebuild the docs.
Props
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
decrementLabel | string | "Decrease" | No | `aria-label` on the decrement button. |
defaultValue | null | number | null | No | Initial uncontrolled value and form-reset seed. |
disabled | boolean | false | No | Disables the field and buttons. |
formatOptions | Intl.NumberFormatOptions | — | No | Display and round-trip parse options (`notation: 'standard'`). |
incrementLabel | string | "Increase" | No | `aria-label` on the increment button. |
invalid | boolean | false | No | Sets `aria-invalid` on the spinbutton. |
locale | string | — | No | `Intl.NumberFormat` locale. |
max | number | — | No | Inclusive maximum (`aria-valuemax`). |
min | number | — | No | Inclusive minimum (`aria-valuemin`). |
modelValue | null | number | — | No | Controlled value. Omit for uncontrolled mode. `null` is empty. |
readonly | boolean | false | No | Focusable; edits and buttons do not change the value. |
required | boolean | false | No | Native `required` on the spinbutton. |
step | number | 1 | No | Step for buttons and arrow keys. |
Emits
None declared.
Models
| Prop | Event | Type | Description |
|---|---|---|---|
modelValue | update:modelValue | null | number | v-model binding for `modelValue`. |
Slots
None declared.
Exposed members
| Name | Type | Description |
|---|---|---|
blur | () => void | Exposed method `blur`. |
decrement | () => void | Exposed method `decrement`. |
element | HTMLInputElement | null | Root element after mount; null before mount. |
focus | (options?: FocusOptions) => void | Exposed method `focus`. |
increment | () => void | Exposed method `increment`. |
Parts and data attributes
| Attribute | Value | Description |
|---|---|---|
data-part | root | Outer layout grouping the buttons and spinbutton. |
data-part | input | Text field with role=spinbutton. |
data-part | decrement | Step-down button. |
data-part | increment | Step-up button. |
data-state | invalid | Consumer-owned invalid on the root container. |
data-state | disabled | Unavailable field on the root container. |
data-state | readonly | Read-only field on the root container. |
CSS variables
None declared.
Accessibility
Role: spinbutton. APG pattern: https://www.w3.org/WAI/ARIA/apg/patterns/spinbutton/.
Required ARIA attributes: none.
Keyboard
| Key | Action | Automated browser test |
|---|---|---|
ArrowUp | Increase by step. | Not reviewed |
ArrowDown | Decrease by step. | Not reviewed |
Home | Jump to min when defined. | Not reviewed |
End | Jump to max when defined. | Not reviewed |
Verification
Each category is reviewed separately. Automated keyboard and axe results do not attest manual or assistive-technology review.
| Category | Status | Evidence |
|---|---|---|
| Automated keyboard | Not reviewed | No declared key is mapped to a browser test yet. |
| Manual interaction | Not reviewed | No review recorded. |
| Assistive technology | Not reviewed | No review recorded. |
Examples
number-input/basic
Labeled spinbutton with min, max, and step.
number-input/bounds
Increment buttons disable at min and max.
number-input/field
Currency formatting inside GhostField.
number-input/form-locale
Hidden submit value stays machine-readable in de-DE.
number-input/ref
Programmatic increment through the exposed API.
number-input/themed
Large block retry delay in seconds from @ghostvue/themes.