Skip to content

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 { 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>
InputTypeDefaultNotes
keysstring | string[] | nullnullShortcut tokens; 'mod' maps to ⌘ (mac) / Ctrl (other). Joined with +. Empty/null → projected content.
ariaLabelstring | nullnullOverride the announced label for the whole combo.

Renders <kbd> elements; symbol modifiers carry an accessible label so screen readers announce the shortcut meaningfully.

Interactive examples live in Storybook under Misc / Kbd. Run pnpm storybook to explore them.