shadcn.io is not affiliated with official shadcn/ui
Kbd examples · Function Keys
Modifier Keys Kbd for React
The Shift, Ctrl and Alt modifier keys in a row.
Most shortcuts start with a modifier. This React example shows Shift, Ctrl and Alt as three separate Kbd caps in a row, the way a key reference lists them, before they're combined into shortcuts.
Preview
Installation
FAQ
Should I show Mac and Windows modifiers separately?
Show the user's own: ⌘ Command, ⌥ Option, ⌃ Control and ⇧ Shift on Mac; Ctrl, Alt and Shift on Windows and Linux. Ctrl usually maps to ⌘ and Alt to ⌥, but not always, so check each shortcut.
Should I document modifiers alone or in shortcuts?
In shortcuts, mostly: a modifier on its own does nothing. A row like this one belongs on a reference page that explains the keys before listing what they combine with.
Should I include the Windows or Command key?
Include ⌘ for Mac users, since most Mac shortcuts use it. The Windows key is mostly reserved for the operating system, so web apps rarely use it.
Are modifier shortcuts accessible?
Holding a modifier while pressing another key is hard for some people. Sticky keys in the operating system help, but every command should also be reachable without a shortcut.
Related
- Special Keys KbdThe Esc, Tab and Enter keys in a row
- Editing Keys KbdThe Home, End, PgUp and PgDn editing keys
- Complex Shortcut KbdA three-key Ctrl Shift P shortcut in one
- Mac Command Symbol KbdThe Mac Command symbol and K grouped as
- F1 Help Key KbdA single F1 key, the usual shortcut for
- F12 DevTools Key KbdA single F12 key, the shortcut that opens