Skip to content

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.

All component references

Props ​

NameTypeDefaultRequiredDescription
decrementLabelstring"Decrease"No`aria-label` on the decrement button.
defaultValuenull | numbernullNoInitial uncontrolled value and form-reset seed.
disabledbooleanfalseNoDisables the field and buttons.
formatOptionsIntl.NumberFormatOptions—NoDisplay and round-trip parse options (`notation: 'standard'`).
incrementLabelstring"Increase"No`aria-label` on the increment button.
invalidbooleanfalseNoSets `aria-invalid` on the spinbutton.
localestring—No`Intl.NumberFormat` locale.
maxnumber—NoInclusive maximum (`aria-valuemax`).
minnumber—NoInclusive minimum (`aria-valuemin`).
modelValuenull | number—NoControlled value. Omit for uncontrolled mode. `null` is empty.
readonlybooleanfalseNoFocusable; edits and buttons do not change the value.
requiredbooleanfalseNoNative `required` on the spinbutton.
stepnumber1NoStep for buttons and arrow keys.

Emits ​

None declared.

Models ​

PropEventTypeDescription
modelValueupdate:modelValuenull | numberv-model binding for `modelValue`.

Slots ​

None declared.

Exposed members ​

NameTypeDescription
blur() => voidExposed method `blur`.
decrement() => voidExposed method `decrement`.
elementHTMLInputElement | nullRoot element after mount; null before mount.
focus(options?: FocusOptions) => voidExposed method `focus`.
increment() => voidExposed method `increment`.

Parts and data attributes ​

AttributeValueDescription
data-partrootOuter layout grouping the buttons and spinbutton.
data-partinputText field with role=spinbutton.
data-partdecrementStep-down button.
data-partincrementStep-up button.
data-stateinvalidConsumer-owned invalid on the root container.
data-statedisabledUnavailable field on the root container.
data-statereadonlyRead-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 ​

KeyActionAutomated browser test
ArrowUpIncrease by step.Not reviewed
ArrowDownDecrease by step.Not reviewed
HomeJump to min when defined.Not reviewed
EndJump 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.

CategoryStatusEvidence
Automated keyboardNot reviewedNo declared key is mapped to a browser test yet.
Manual interactionNot reviewedNo review recorded.
Assistive technologyNot reviewedNo review recorded.

Examples ​

number-input/basic ​

Example source

Basic Headless

Labeled spinbutton with min, max, and step.

Current page size: 25

number-input/bounds ​

Example source

Bounds Headless

Increment buttons disable at min and max.

number-input/field ​

Example source

Field Headless

Currency formatting inside GhostField.

Filter: none

number-input/form-locale ​

Example source

Form locale Headless

Hidden submit value stays machine-readable in de-DE.

Submitted:

number-input/ref ​

Example source

Component ref Headless

Programmatic increment through the exposed API.

Score: 10

number-input/themed ​

Example source

Themed

Large block retry delay in seconds from @ghostvue/themes.