# CommandMenu

A dialog-backed command palette with grouped commands, local filtering, keyboard movement, and custom select events.

## Notes

- Use CommandMenu for local command palettes, not for remote search infrastructure.
- The component emits snurble-command-select with the chosen value.
- Because it is dialog-backed, open it from a user gesture in production interactions.

## Properties

| Name | Type | Default | Description |
| ---- | ---- | ------- | ----------- |
| id | `string` | - | Dialog id. |
| open | `boolean` | false | Open on initial load. |
| title | `string` | 'Command menu' | Dialog title. |
| placeholder | `string` | 'Type a command…' | Search input placeholder. |
| groups | `CommandMenuGroup[]` | - | Grouped command items. |
| emptyText | `string` | 'No commands found.' | Empty state text. |
| class | `string` | - | Additional CSS classes. |

## Example

```astro
<CommandMenu open title="Commands" groups={[{ label: "Docs", items: [{ label: "Open components", value: "components" }] }]} />
```
