# Shortcuts Dialog

> The keyboard shortcuts sheet: press ? anywhere to open it, then filter by action or by keys ("⌘K", "g i"). Groups flow into two columns, chords render as keycaps (⌘⇧K on Mac, Ctrl + Shift + K on Windows), sequences read "G then I", and every binding has a spoken label. Mac or Windows keys are detected, with a switch. Also exports KeyCombo.

- Slug: `shortcuts-dialog`
- Category: [Dialogs](https://www.assembli.design/category/dialogs.md)
- Type: component
- Tags: keyboard, shortcuts, hotkeys, kbd, help, modal, search
- npm dependencies: @base-ui/react, lucide-react
- shadcn/ui dependencies: none
- Live preview: https://www.assembli.design/preview/shortcuts-dialog
- Page: https://www.assembli.design/components/shortcuts-dialog

![Shortcuts Dialog preview](https://www.assembli.design/thumbnails/shortcuts-dialog-light.png)

## Props

Other props pass through to the root element.

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `groups` (required) | `ShortcutGroup[]` |  |  |
| `trigger` | `React.ReactElement` |  | The element that opens the dialog, e.g. a "Keyboard shortcuts" menu item. |
| `open` | `boolean` |  |  |
| `defaultOpen` | `boolean` | `false` |  |
| `onOpenChange` | `(open: boolean) => void` |  |  |
| `hotkey` | `string \| null` | `"?"` | A key that opens the dialog from anywhere outside a text field. `null` turns it off. Defaults to `"?"`. |
| `title` | `React.ReactNode` | `"Keyboard shortcuts"` |  |
| `description` | `React.ReactNode` | `"Move faster without leaving the keyboard."` |  |
| `platform` | `Platform` |  | Forces Mac or Windows keys. Defaults to the reader's platform, with a switch in the header. |
| `hidePlatformSwitch` | `boolean` |  | Hides the Mac / Windows switch. |
| `className` | `string` |  |  |

## Install

One-time setup (needs a subscription):

1. Add the registry to the project's `components.json`: `{"@assembli":{"url":"https://www.assembli.design/r/{name}.json","headers":{"Authorization":"Bearer ${ASSEMBLI_API_KEY}"}}}` (merge into `"registries"`).
2. Put an API key from https://www.assembli.design/account in `.env.local` as `ASSEMBLI_API_KEY=asm_…`.

Then install with the shadcn CLI (writes `components/shortcuts-dialog/shortcuts-dialog.tsx` and installs dependencies):

```bash
npx shadcn@latest add @assembli/shortcuts-dialog
```

Registry item JSON: https://www.assembli.design/r/shortcuts-dialog.json (send `Authorization: Bearer <api key>`)

## Code

> Component source needs an Assembli subscription ($12/month or $96/year) and an API key sent as `Authorization: Bearer <key>`. To get one without copying anything, POST https://www.assembli.design/api/agent/login (or call the MCP tool connect_account), show the user the link it returns, and poll https://www.assembli.design/api/agent/token for the key. Or subscribe at https://www.assembli.design/pricing and create a key at https://www.assembli.design/account.
