Skip to content
shadcn.io

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.

Framework
UI library

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

Preview width
ShiftCtrlAlt

Installation

Sign in to get your install command
Free with an account. It carries your token, so the CLI installs everything in one go.

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.

In what order should modifiers appear in a shortcut?

On Mac, ⌃ ⌥ ⇧ ⌘, then the key. On Windows, Ctrl first, as in Ctrl Shift P or Ctrl Alt Delete. Keep one order across your app.

What about shortcuts the browser already uses?

Avoid them where you can: Ctrl T, Ctrl W and Ctrl N belong to the browser and can't be overridden. Others, like Ctrl S or Ctrl K, can be caught with preventDefault; do it only when your app has a clear use for them.