GhostNumberInput reference
Package: @ghostvue/themes. Status: experimental (stability policy).
Themed wrapper around headless GhostNumberInput. Forwards behavioral props and adds size and block layout hooks. class and style go to a frame around the whole control; other attributes reach the text input.
Generated from the component manifest. Edit the manifest or Vue source, then rebuild the docs.
Props
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
modelValue | number | null | — | No | Controlled value forwarded to the unstyled spinbutton. |
defaultValue | number | null | null | No | Initial uncontrolled value forwarded to the unstyled spinbutton. |
min | number | — | No | Inclusive minimum forwarded to the unstyled spinbutton. |
max | number | — | No | Inclusive maximum forwarded to the unstyled spinbutton. |
step | number | 1 | No | Step amount forwarded to the unstyled spinbutton. |
locale | string | — | No | Intl locale forwarded to the unstyled spinbutton. |
formatOptions | Intl.NumberFormatOptions | — | No | Intl format options forwarded to the unstyled spinbutton. |
disabled | boolean | false | No | Forwards disabled semantics. |
readonly | boolean | false | No | Forwards readonly semantics. |
invalid | boolean | false | No | Forwards invalid semantics. |
required | boolean | false | No | Forwards required semantics. |
decrementLabel | string | "Decrease" | No | Accessible decrement label. |
incrementLabel | string | "Increase" | No | Accessible increment label. |
size | 'sm' | 'md' | 'lg' | "md" | No | Control size. Default omits data-size. |
block | boolean | false | No | Fill the container's inline size via data-block. Without it the control fits about eight digits and fills a GhostField. |
Emits
None declared.
Models
| Prop | Event | Type | Description |
|---|---|---|---|
modelValue | update:modelValue | number | null | v-model binding forwarded to the unstyled spinbutton. |
Slots
None declared.
Exposed members
| Name | Type | Description |
|---|---|---|
element | HTMLInputElement | null | The spinbutton input after mount. |
focus | (options?: FocusOptions) => void | Focus the spinbutton. |
blur | () => void | Blur the spinbutton. |
increment | () => void | Step up when not disabled or readonly. |
decrement | () => void | Step down when not disabled or readonly. |
Parts and data attributes
| Attribute | Value | Description |
|---|---|---|
data-part | root | Flex row grouping buttons and input. |
data-part | input | Themed spinbutton field. |
data-part | decrement | Step-down button. |
data-part | increment | Step-up button. |
data-state | invalid | Forwarded invalid styling on the root. |
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 |
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/order-limits
Bounded, currency-formatted, and disabled GhostNumberInput controls with live total.
number-input/workshop-booking
Seat and session-length limits with unit-formatted values, disabled steppers at the bound, and a limit message.
number-input/themed
Large block retry delay in seconds from @ghostvue/themes.