Skip to content

GhostField reference ​

Package: @ghostvue/vue. Status: experimental (stability policy).

Compound field primitive connecting GhostFieldLabel, GhostFieldDescription, GhostFieldError, and GhostFieldControl to a single control via useGhostId and scoped slot props. Composes with GhostInput, GhostTextarea, and GhostCheckbox without API changes.

Generated from the component manifest. Edit the manifest or Vue source, then rebuild the docs.

All component references

Props ​

NameTypeDefaultRequiredDescription
disabledbooleanfalseNoPropagates disabled semantics to the control.
idstring—NoOptional control id override for label association.
invalidboolean—NoPropagates invalid semantics and root data-state.
namestring—NoCanonical dot-path key associating this field with an ancestor `GhostForm`.
requiredbooleanfalseNoPropagates required semantics to the control.

Emits ​

None declared.

Models ​

None declared.

Slots ​

NameDescription
defaultField parts (label, description, control, error) in consumer-chosen order.

Slot props: default ​

NameTypeDescription
dirtybooleanSlot prop `dirty`.
errorstring | undefinedSlot prop `error`.
errorsreadonly string[]Slot prop `errors`.
invalidbooleanSlot prop `invalid`.
touchedbooleanSlot prop `touched`.

Exposed members ​

NameTypeDescription
elementHTMLElement | nullRoot grouping element after mount.

Parts and data attributes ​

AttributeValueDescription
data-partrootGrouping container on GhostField.
data-partlabelRendered by GhostFieldLabel.
data-partdescriptionRendered by GhostFieldDescription.
data-parterrorRendered by GhostFieldError when the slot has content.
data-partcontrolScoped slot bridge from GhostFieldControl (no DOM host).
data-stateinvalidRoot invalid state; wins over disabled.
data-statedisabledRoot disabled state when not invalid.

CSS variables ​

None declared.

Accessibility ​

Role: generic. APG pattern: https://www.w3.org/WAI/ARIA/apg/patterns/textfield/.

Required ARIA attributes: aria-describedby, aria-invalid.

Keyboard ​

None declared.

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 ​

field/billing-address-headless ​

Example source

Headless address fieldset Headless

The same native fieldset recipe with headless GhostField parts and consumer-owned styles.

Shipping address

Deliveries go to this address.

field/basic ​

Example source

Labeled input Headless

Label, hint, and control id wiring for GhostInput.

field/invalid ​

Example source

Invalid field Headless

Required filter with error copy and aria-invalid.

Enter at least two characters.

field/textarea ​

Example source

Textarea field Headless

GhostTextarea composed with description.

field/themed ​

Example source

Themed stack

Default vertical spacing from @ghostvue/themes.