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.
Props
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
modelValue | boolean | — | No | Controlled checked state, forwarded to the unstyled GhostCheckbox. |
defaultValue | boolean | false | No | Initial checked state when modelValue is omitted, forwarded to the unstyled GhostCheckbox. |
indeterminate | boolean | false | No | Mixed state, forwarded to the unstyled GhostCheckbox. |
disabled | boolean | false | No | Forwards native disabled semantics to the unstyled GhostCheckbox. |
size | 'sm' | 'md' | 'lg' | "md" | No | Control size. The default omits data-size so CSS can treat a missing hook as md. |
tone | 'accent' | 'neutral' | 'danger' | "accent" | No | Semantic color intent. The default omits data-tone. |
Emits
None declared.
Models
| Prop | Event | Type | Description |
|---|---|---|---|
modelValue | update:modelValue | boolean | Checked state. Forwards update:modelValue from the unstyled GhostCheckbox. |
Slots
None declared.
Exposed members
| Name | Type | Description |
|---|---|---|
element | HTMLInputElement | null | The native checkbox after mount; null before mount and after unmount. Delegates to the unstyled GhostCheckbox. |
focus | (options?: FocusOptions) => void | Focuses the native checkbox when it is mounted and enabled. Delegates to the unstyled GhostCheckbox. |
blur | () => void | Removes focus from the native checkbox when it is mounted. Delegates to the unstyled GhostCheckbox. |
Parts and data attributes
| Attribute | Value | Description |
|---|---|---|
data-part | root | The native checkbox input inside the display:contents themed scope. |
data-state | checked | Checked and not mixed. Fills the box and draws a checkmark. |
data-state | indeterminate | Mixed visual state. Fills the box and draws a dash. Wins over checked. |
CSS variables
| Name | Description |
|---|---|
--ghost-surface-bg | Unchecked box fill and mix surface for hover. |
--ghost-action-primary-bg | Checked and mixed fill for the accent tone. |
--ghost-action-primary-fg | Checkmark and dash color on the accent tone. |
--ghost-action-primary-border | Box border on the accent tone. |
--ghost-action-neutral-bg | Checked and mixed fill for the neutral tone. |
--ghost-action-neutral-fg | Checkmark and dash color on the neutral tone. |
--ghost-action-neutral-border | Box border on the neutral tone. |
--ghost-action-danger-bg | Checked and mixed fill for the danger tone. |
--ghost-action-danger-fg | Checkmark and dash color on the danger tone. |
--ghost-action-danger-border | Box border on the danger tone. |
--ghost-action-disabled-bg | Unavailable box fill. |
--ghost-action-disabled-fg | Unavailable checkmark and dash color. |
--ghost-action-disabled-border | Unavailable box border. |
--ghost-action-icon-size | Painted box size inside the hit target. |
--ghost-action-label-family | Font for the checked glyph painted on ::before. |
--ghost-action-label-weight | Weight for the checked glyph. |
--ghost-radius-sm | Corner radius of the painted box. Smaller than action-radius so the 1.1em box stays square. |
--ghost-action-spinner-width | Thickness of the mixed-state dash. |
--ghost-action-duration | Duration of color transitions on the painted box. |
--ghost-border-hairline-width | Box border thickness. |
--ghost-state-layer-hover | Hover mix amount on the current tone. |
--ghost-motion-press-scale | Pressed scale. 1 under reduced motion. |
--ghost-motion-easing-standard | Easing for color transitions. |
--ghost-motion-duration-instant | Reduced-motion color transition duration. |
--ghost-focus-ring-color | Outer color of the two-color keyboard focus indicator. |
--ghost-focus-ring-contrast | Inner color of the two-color keyboard focus indicator. |
--ghost-focus-ring-offset | Gap between the painted box and the focus ring. |
--ghost-focus-ring-width | Thickness of the focus outline. |
--ghost-control-size-sm-min | Hit target size for size sm. |
--ghost-control-size-md-min | Hit target size for size md. |
--ghost-control-size-lg-min | Hit target size for size lg. |
Accessibility
Role: checkbox. APG pattern: https://www.w3.org/WAI/ARIA/apg/patterns/checkbox/.
Required ARIA attributes: none.
Keyboard
| Key | Action | Automated browser test |
|---|---|---|
Space | Toggle checked when the control is enabled. Follows native mixed activation. | Not reviewed |
Enter | Does 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.
| 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
checkbox/notification-preferences
Email preferences panel with described options, a mixed select-all, and a locked required alert.
checkbox/themed
Size and tone on the @ghostvue/themes wrapper, with checked, mixed, and disabled states.