Skip to content

GhostCheckbox reference ​

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

Themed wrapper around headless GhostCheckbox. Same behavioral props plus size and tone. Importing it loads the default stylesheet and scopes styles to this instance. Hand-written until GHO-13 generates manifests.

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

All component references

Props ​

NameTypeDefaultRequiredDescription
modelValueboolean—NoControlled checked state, forwarded to the unstyled GhostCheckbox.
defaultValuebooleanfalseNoInitial checked state when modelValue is omitted, forwarded to the unstyled GhostCheckbox.
indeterminatebooleanfalseNoMixed state, forwarded to the unstyled GhostCheckbox.
disabledbooleanfalseNoForwards native disabled semantics to the unstyled GhostCheckbox.
size'sm' | 'md' | 'lg'"md"NoControl size. The default omits data-size so CSS can treat a missing hook as md.
tone'accent' | 'neutral' | 'danger'"accent"NoSemantic color intent. The default omits data-tone.

Emits ​

None declared.

Models ​

PropEventTypeDescription
modelValueupdate:modelValuebooleanChecked state. Forwards update:modelValue from the unstyled GhostCheckbox.

Slots ​

None declared.

Exposed members ​

NameTypeDescription
elementHTMLInputElement | nullThe native checkbox after mount; null before mount and after unmount. Delegates to the unstyled GhostCheckbox.
focus(options?: FocusOptions) => voidFocuses the native checkbox when it is mounted and enabled. Delegates to the unstyled GhostCheckbox.
blur() => voidRemoves focus from the native checkbox when it is mounted. Delegates to the unstyled GhostCheckbox.

Parts and data attributes ​

AttributeValueDescription
data-partrootThe native checkbox input inside the display:contents themed scope.
data-statecheckedChecked and not mixed. Fills the box and draws a checkmark.
data-stateindeterminateMixed visual state. Fills the box and draws a dash. Wins over checked.

CSS variables ​

NameDescription
--ghost-surface-bgUnchecked box fill and mix surface for hover.
--ghost-action-primary-bgChecked and mixed fill for the accent tone.
--ghost-action-primary-fgCheckmark and dash color on the accent tone.
--ghost-action-primary-borderBox border on the accent tone.
--ghost-action-neutral-bgChecked and mixed fill for the neutral tone.
--ghost-action-neutral-fgCheckmark and dash color on the neutral tone.
--ghost-action-neutral-borderBox border on the neutral tone.
--ghost-action-danger-bgChecked and mixed fill for the danger tone.
--ghost-action-danger-fgCheckmark and dash color on the danger tone.
--ghost-action-danger-borderBox border on the danger tone.
--ghost-action-disabled-bgUnavailable box fill.
--ghost-action-disabled-fgUnavailable checkmark and dash color.
--ghost-action-disabled-borderUnavailable box border.
--ghost-action-icon-sizePainted box size inside the hit target.
--ghost-action-label-familyFont for the checked glyph painted on ::before.
--ghost-action-label-weightWeight for the checked glyph.
--ghost-radius-smCorner radius of the painted box. Smaller than action-radius so the 1.1em box stays square.
--ghost-action-spinner-widthThickness of the mixed-state dash.
--ghost-action-durationDuration of color transitions on the painted box.
--ghost-border-hairline-widthBox border thickness.
--ghost-state-layer-hoverHover mix amount on the current tone.
--ghost-motion-press-scalePressed scale. 1 under reduced motion.
--ghost-motion-easing-standardEasing for color transitions.
--ghost-motion-duration-instantReduced-motion color transition duration.
--ghost-focus-ring-colorOuter color of the two-color keyboard focus indicator.
--ghost-focus-ring-contrastInner color of the two-color keyboard focus indicator.
--ghost-focus-ring-offsetGap between the painted box and the focus ring.
--ghost-focus-ring-widthThickness of the focus outline.
--ghost-control-size-sm-minHit target size for size sm.
--ghost-control-size-md-minHit target size for size md.
--ghost-control-size-lg-minHit target size for size lg.

Accessibility ​

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

Required ARIA attributes: none.

Keyboard ​

KeyActionAutomated browser test
SpaceToggle checked when the control is enabled. Follows native mixed activation.Not reviewed
EnterDoes not toggle. In a form, submits.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 ​

checkbox/notification-preferences ​

Example source

Notification preferences

Email preferences panel with described options, a mixed select-all, and a locked required alert.

Email notifications

Choose what reaches ada@analytical-engines.example.

Project activity

Updates from projects you follow.

Account

Security and billing for you.

checkbox/themed ​

Example source

Themed

Size and tone on the @ghostvue/themes wrapper, with checked, mixed, and disabled states.

States

Tone and size