Skip to main content
v7

Shortcut

Renders keyboard shortcut combinations as styled kbd elements with platform-aware modifier keys.

Package@g4rcez/componentsSectionDisplay Components

Examples

Simple Shortcuts

Single key or two-key combos rendered as keyboard badges.

Simple
EscapeEnterTabCtrl+S

Platform-Adaptive Modifiers

Mod renders as ⌘ on macOS and Ctrl on other platforms. Alt renders as ⌥ on macOS.

Platform-adaptive
Ctrl+KCtrl+Shift+PAlt+F4

Shortcuts in Context

Shortcuts paired with their actions in a command list.

In context
  • Open command paletteCtrl+K
  • Save documentCtrl+S
  • Find in fileCtrl+F
  • Close tabCtrl+W

When to use Shortcut

Use when

You need the documented Shortcut interaction or presentation in a product workflow.

Avoid when

A native HTML element already provides the Shortcut behavior you need.

Accessibility

Keep the Shortcut labeled and use its documented keyboard interaction. The component preserves visible focus and communicates state without relying on color alone.