Kbd
Render keyboard shortcuts as styled key caps. Parses +-separated combinations, maps key names to symbols (⌘, ⇧, ⌥), and swaps modifiers per platform.
Import
Section titled “Import”import { Kbd } from "@nu-appdev/northwestern-starlight-theme/components";Basic Usage
Section titled “Basic Usage”Pass key combinations as children, separated by +.
Copy: ⌃ C Ctrl C · Paste: ⌃ V Ctrl V · Undo: ⌃ Z Ctrl Z
<Kbd>Ctrl+C</Kbd><Kbd>Ctrl+V</Kbd><Kbd>Ctrl+Z</Kbd>Platform-Aware Modifiers
Section titled “Platform-Aware Modifiers”Use Mod, Command, Ctrl, Alt, or Option in the key string. Platform is detected automatically — Mac users see ⌘, Windows/Linux users see Ctrl.
Open search: ⌘ K Ctrl K · Command palette: ⌘ ⇧ P Ctrl ⇧ P · Inspector: ⌥ ⇧ I Alt ⇧ I
<Kbd>Mod+K</Kbd><Kbd>Mod+Shift+P</Kbd><Kbd>Alt+Shift+I</Kbd>Key Symbol Mapping
Section titled “Key Symbol Mapping”Key names map to standard symbols. Unrecognized names render as-is ( A , F12 ). Modifier symbols change per platform.
With Description
Section titled “With Description”The tip prop wraps the shortcut in a <Tooltip/>, showing a description on hover.
⌘ ⇧ P Ctrl ⇧ P Open command palette ⌘ S Ctrl S Save file
<Kbd tip="Open command palette">Mod+Shift+P</Kbd><Kbd tip="Save file">Mod+S</Kbd>Explicit Keys Array
Section titled “Explicit Keys Array”Use the keys array to specify each key explicitly.
⌃ ⇧ I Ctrl ⇧ I ⌘ K Ctrl K
<Kbd keys={["Ctrl", "Shift", "I"]} /><Kbd keys={["Command", "K"]} /><Kbd> Props
Section titled “<Kbd> Props”Implementation: Kbd.astro