Skip to content

GhostKbd reference ​

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

Headless native kbd for inline keyboard-shortcut display. useGhostKbd owns key-token labels and SSR-safe platform detection; GhostKbd is the thin unstyled element. Themed keycap chrome lives on @ghostvue/themes.

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

All component references

Props ​

NameTypeDefaultRequiredDescription
keysreadonly string[] | string"[]"NoKey tokens rendered as nested kbd elements. A string is one key; an array is a combination. Tokens are matched case-insensitively. Unknown tokens render as given, except a single letter is uppercased.
platformGhostKbdPlatform"auto"NoModifier label set. auto uses PC labels until after mount, then Apple labels when the browser looks like Apple. Explicit apple and pc are deterministic from the prop.

Emits ​

None declared.

Models ​

None declared.

Slots ​

NameDescription
defaultKey content. When keys is omitted, this is the entire kbd contents. When keys is set, this is appended after a plus separator as extra combination content.

Slot props: default ​

None declared.

Exposed members ​

None declared.

Parts and data attributes ​

AttributeValueDescription
data-partrootThe outer native kbd element.
data-partkeyNested kbd for one token from the keys prop.
data-partseparatorLiteral plus between keys. Stays in the accessibility tree.

CSS variables ​

None declared.

Accessibility ​

Role: generic. APG pattern: https://www.w3.org/WAI/ARIA/apg/practices/names-and-descriptions/.

Required ARIA attributes: none.

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 ​

kbd/basic ​

Example source

Basic Headless

Native kbd chrome for a single key.

Press F5 to reload.

kbd/composable ​

Example source

Composable Headless

Same contract as GhostKbd, applied to a native host.

Ctrl+K

kbd/combination ​

Example source

Combination Headless

Key tokens plus a trailing slot key.

Open the command palette with Ctrl+K.

kbd/platform ​

Example source

Platform labels Headless

Explicit Apple and PC modifier labels.

Apple: ⌘+⇧+P

PC: Ctrl+Shift+P