shadcn.io is not affiliated with official shadcn/ui
Kbd examples · Platform Specific
Mac Command Symbol Kbd for React
The Mac Command symbol and K grouped as the ⌘K shortcut.
Mac users read shortcuts with symbols, the way macOS menus show them. This React example writes the Command key as ⌘, the character printed on Mac keyboards, and groups it with K in a KbdGroup. The symbol is plain text, so it needs no icon and takes the cap's font and color.
Preview
Installation
FAQ
When should I show ⌘ instead of Ctrl?
For Mac users. Detect the platform and switch, as the Platform-Aware Shortcut example does, or show both, like ⌘K / Ctrl K, when you can't know.
What is the ⌘ symbol and how do I type it?
It's the place of interest sign, U+2318. Paste it from macOS's Character Viewer (Ctrl ⌘ Space) or copy it from here; in code it's just a character in the string.
Which ⌘ shortcuts are worth documenting?
The ones specific to your app, plus any standard ones you change. People already know ⌘C, ⌘V, ⌘Z and ⌘S; ⌘K for search or ⌘Enter to send are worth a hint.
Why do Macs use Command instead of Ctrl?
The first Macintosh gave app shortcuts their own key, so Control could keep its terminal meaning. That's why Mac shortcuts use ⌘ where Windows uses Ctrl.
Related
- Platform-Aware Shortcut KbdA shortcut that reads ⌘K on Apple devices
- Mac Option Symbol KbdThe Mac Option symbol and Tab grouped as
- Mac Control Symbol KbdThe Mac Control symbol and Space grouped
- Windows Key KbdThe Windows key and R grouped as the Win
- Command with Icon KbdA Command K shortcut with the Command key
- Arrow Keys Cross Pattern KbdFour arrow keys in the inverted T of a