Skip to content
synccn

Shortcuts Dialog

New

The "?" 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-dialog

First 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
    boolean

    Controlled open state.

  • onOpenChange
    (open: boolean) => void

    —

  • openWith
    string | false

    Default "?"

    Key that opens the dialog when you're not typing in a field. Pass false to turn it off.

  • title
    string

    Default "Keyboard shortcuts"

    Heading.

Dependencies

Read from the component's imports when the site builds. The CLI installs all of these for you.

Components

Helpers

  • lib/hooksuseControllable (works controlled or uncontrolled)

npm packages

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