Shortcuts Dialog
NewThe "?" cheat sheet: grouped, searchable shortcuts shown with each platform's keys.
Or press ? anywhere on this page
Installation
$ pnpm dlx shadcn@latest add @synccn/shortcuts-dialogFirst time in this project? Connect synccn with one command.
Usage
import { ShortcutsDialog } from "@/components/ui/shortcuts-dialog";<ShortcutsDialog groups={groups} />API reference
Generated from the component's TypeScript types, so it always matches the code.
ShortcutsDialog
The "?" cheat sheet: every shortcut in groups, searchable, with keys shown the way the person's platform writes them. Opens with "?" by default.
- groupsrequired
ShortcutGroup[]—
- open
booleanControlled open state.
- onOpenChange
(open: boolean) => void—
- openWith
string | falseDefault
"?"Key that opens the dialog when you're not typing in a field. Pass false to turn it off.
- title
stringDefault
"Keyboard shortcuts"Heading.
Dependencies
Read from the component's imports when the site builds. The CLI installs all of these for you.
Components
- Dialog for
Dialog - Shortcut Recorder for
formatShortcut
Helpers
- lib/hooksuseControllable (works controlled or uncontrolled)
npm packages
- clsx for cn()
- tailwind-merge for cn()
- lucide-react for Search
Keyboard
- ?Open the dialog
- TaborShift+TabMove focus; it stays inside while open
- EscClose
Accessibility
- Shortcuts are a description list per group, so each label is paired with its keys.
From the source
Read from this component's code when the site builds, so it can't drift.
- ARIA attributes: aria-label
- Labels are tied to their controls