Keyboard Shortcuts

Keyboard Shortcuts is a React cheat sheet dialog of grouped shortcuts opened with the ? key or a button, searchable, with Command glyphs on Mac and Ctrl elsewhere.

src/registry/ui/keyboard-shortcuts.tsx/r/keyboard-shortcuts.json

Installation#

bash
npx shadcn@latest add @minidev/keyboard-shortcuts

MiniDev UI is in the shadcn registry directory, so the short form works with no setup. Older CLI versions can use the full URL: npx shadcn@latest add https://ui.minidev.pro/r/keyboard-shortcuts.json

Usage#

tsx
import { KeyboardShortcuts } from "@/components/ui/keyboard-shortcuts"

export function Example() {
  return <KeyboardShortcuts />
}

API reference#

KeyboardShortcuts props
PropTypeDefault
groupsKeyboardShortcutGroup[]SAMPLE_GROUPS
titlestring"Keyboard shortcuts"
hotkeystring"?"
openboolean-
onOpenChange(open: boolean) => void-
showTriggerbooleantrue
triggerLabelstring"Keyboard shortcuts"
classNamestring-

Dependencies#

npm

lucide-react
All dialog, drawer and popover components

Learn more