GhostCheckbox reference
Package: @ghostvue/vue. Status: experimental (stability policy).
Headless native checkbox. useGhostCheckbox owns boolean v-model and mixed state; GhostCheckbox is the thin unstyled input. Themed visual props live on @ghostvue/themes.
Generated from the component manifest. Edit the manifest or Vue source, then rebuild the docs.
Props
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
defaultValue | boolean | false | No | Initial checked state when modelValue is omitted. Later changes are ignored. |
disabled | boolean | false | No | Native disabled semantics: no activation, no sequential focus, and excluded from form submission. |
indeterminate | boolean | false | No | Mixed state for select-all and similar. Applied through the DOM indeterminate property. Consumer-owned; not part of the v-model. |
modelValue | boolean | — | No | Controlled checked state. Omit it for uncontrolled use. undefined is uncontrolled; false is unchecked. Mixed is the indeterminate prop, not a third model value. |
Emits
None declared.
Models
| Prop | Event | Type | Description |
|---|---|---|---|
modelValue | update:modelValue | boolean | Checked state. Activation emits the native post-click boolean. |
Slots
None declared.
Exposed members
| Name | Type | Description |
|---|---|---|
blur | () => void | Removes focus from the native checkbox when it is mounted. No-op before mount. |
element | HTMLInputElement | null | The native checkbox after mount; null before mount and after unmount. |
focus | (options?: FocusOptions) => void | Focuses the native checkbox when it is mounted and enabled. No-op before mount. |
Parts and data attributes
| Attribute | Value | Description |
|---|---|---|
data-part | root | The native checkbox input. |
data-state | checked | Checked and not mixed. Omitted while unchecked. |
data-state | indeterminate | Mixed visual and AT state. Wins over checked when both apply. |
CSS variables
None declared.
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. | GhostCheckbox › toggles from Space, shows mixed select-all, and has no axe violations (@ghostvue/vue) |
Enter | Does not toggle. In a form, submits. | GhostCheckbox › toggles from Space, shows mixed select-all, and has no axe violations (@ghostvue/vue) |
Verification
Each category is reviewed separately. Automated keyboard and axe results do not attest manual or assistive-technology review.
| Category | Status | Evidence |
|---|---|---|
| Automated keyboard | Passed | Every declared key maps to a Chromium browser test that CI runs and requires to pass on every commit. |
| Manual interaction | Not reviewed | No review recorded. |
| Assistive technology | Not reviewed | No review recorded. |
Examples
checkbox/basic
Labeled native checkbox with a boolean v-model.
checkbox/composable
Same contract as GhostCheckbox, applied to a native host.
checkbox/indeterminate
Select-all mixed state computed from child checkboxes.
checkbox/ref
Template refs expose element, focus, and blur.