# Create Menu

> The "New" button of a productivity app: a primary trigger that opens everything you can create, each with a tinted icon tile, a one-line description and a single-key shortcut that creates it while the menu is open. "From template" and "Import" submenus, and a page-wide hotkey (C) that opens the menu from anywhere. Keyboard and typeahead from Base UI.

- Slug: `create-menu`
- Category: [Menus](https://www.assembli.design/category/menus.md)
- Type: component
- Tags: dropdown, create, new, templates, shortcuts
- npm dependencies: @base-ui/react, lucide-react
- shadcn/ui dependencies: none
- Live preview: https://www.assembli.design/preview/create-menu
- Page: https://www.assembli.design/components/create-menu

![Create Menu preview](https://www.assembli.design/thumbnails/create-menu-light.png)

## Props

Other props pass through to the root element.

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `items` | `CreateItem[]` | `DEFAULT_ITEMS` |  |
| `templates` | `CreateTemplate[]` | `DEFAULT_TEMPLATES` | "From template" submenu. Pass `[]` to hide it. |
| `imports` | `CreateTemplate[]` | `DEFAULT_IMPORTS` | "Import" submenu. Pass `[]` to hide it. |
| `label` | `string` | `"New"` | Trigger text. |
| `hotkey` | `string \| false` | `"c"` | A key that opens the menu from anywhere on the page, or `false`. |
| `onCreate` | `(id: string, source: CreateSource) => void` |  |  |
| `onBrowseTemplates` | `() => void` |  | Called by "Browse all templates". |
| `open` | `boolean` |  |  |
| `defaultOpen` | `boolean` | `false` |  |
| `onOpenChange` | `(open: boolean) => void` |  |  |

## 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/create-menu/create-menu.tsx` and installs dependencies):

```bash
npx shadcn@latest add @assembli/create-menu
```

Registry item JSON: https://www.assembli.design/r/create-menu.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.
