Kbd
<ax-kbd> renders keyboard-shortcut keycaps. It’s platform-aware: modifier tokens resolve to
⌘/⌥/⌃/⇧ on macOS and Ctrl/Alt/Win elsewhere. Pass keys via the keys input or project content.
Import
Section titled “Import”import { AxKbdComponent } from '@axisui-ng/misc';<!-- resolves to "Ctrl K" on Windows/Linux, "⌘ K" on macOS --><ax-kbd keys="mod+k" />
<!-- explicit keys as an array --><ax-kbd [keys]="['Shift', 'Enter']" />
<!-- projected content --><ax-kbd>Esc</ax-kbd>Inputs
Section titled “Inputs”| Input | Type | Default | Notes |
|---|---|---|---|
keys | string | string[] | null | null | Shortcut tokens; 'mod' maps to ⌘ (mac) / Ctrl (other). Joined with +. Empty/null → projected content. |
ariaLabel | string | null | null | Override the announced label for the whole combo. |
Accessibility
Section titled “Accessibility”Renders <kbd> elements; symbol modifiers carry an accessible label so screen readers announce the
shortcut meaningfully.
Storybook
Section titled “Storybook”Interactive examples live in Storybook under Misc / Kbd. Run pnpm storybook to explore them.