# Menu A list of actions or options revealed on demand. ## Installation Start from a Svelte 5 application, then install the component package, shared theme, and Bits UI peer: ```bash pnpm add coss-svelte @coss-svelte/theme bits-ui ``` Import `@coss-svelte/theme/style-coss.css` after Tailwind from the application's global stylesheet. ## Usage ```svelte Open menu Playback Shuffle Repeat Enhanced Audio Sort by Artist Album Title Auto save Add to Playlist Jazz Rock Hard Rock Soft Rock Classic Rock Metal Punk Grunge Alternative Indie Electronic Pop ``` ## Anatomy - `Menu` - `MenuCheckboxItem` - `MenuGroup` - `MenuGroupLabel` - `MenuItem` - `MenuPopup` - `MenuRadioGroup` - `MenuRadioItem` - `MenuSeparator` - `MenuShortcut` - `MenuSub` - `MenuSubPopup` - `MenuSubTrigger` - `MenuTrigger` ## API Reference ### Menu A list of actions or options revealed on demand. | Prop | Type | Default | Description | | --- | --- | --- | --- | | `bind:open` | `boolean` | `false` | Open state for the popup or disclosure. Bind with `bind:open`. | | `items` | `MenuItem[]` | `[]` | Items rendered by the component's built-in fallback composition. | | `label` | `string` | `"Menu"` | Accessible label or fallback visible label for the control. | **Composition and refs** - `children: Snippet<[]>` Inherits from [Bits UI DropdownMenu.Root](https://bits-ui.com/docs/components/dropdown-menu#root). ### MenuCheckboxItem Renders one selectable or repeated item. **Composition and refs** - `children: Snippet<[MenuCheckboxItemSnippetProps]>` - `bind:ref: HTMLElement \| null` Inherits from [Bits UI DropdownMenu.CheckboxItem](https://bits-ui.com/docs/components/dropdown-menu#checkbox-item). ### MenuGroup Groups related items inside the parent component. **Composition and refs** - `children: Snippet<[]>` - `bind:ref: HTMLElement \| null` Inherits from [Bits UI DropdownMenu.Group](https://bits-ui.com/docs/components/dropdown-menu#group). ### MenuGroupLabel Labels a group of related items. **Composition and refs** - `children: Snippet<[]>` - `bind:ref: HTMLElement \| null` Inherits from [Bits UI DropdownMenu.GroupHeading](https://bits-ui.com/docs/components/dropdown-menu#group-heading). ### MenuItem Renders one selectable or repeated item. | Prop | Type | Default | Description | | --- | --- | --- | --- | | `variant` | `string` | `"default"` | Visual variant for the component. | **Composition and refs** - `children: Snippet<[]>` - `bind:ref: HTMLElement \| null` Inherits from [Bits UI DropdownMenu.Item](https://bits-ui.com/docs/components/dropdown-menu#item). ### MenuPopup Renders the floating or modal surface for the parent component. | Prop | Type | Default | Description | | --- | --- | --- | --- | | `portalProps` | `{ disabled?: boolean; to?: PortalTarget }` | `{}` | Configures the exact Bits Portal target (`to`) or renders inline when `disabled`. | **Composition and refs** - `children: Snippet<[]>` - `bind:ref: HTMLElement \| null` Inherits from [Bits UI DropdownMenu.Content](https://bits-ui.com/docs/components/dropdown-menu#content). ### MenuRadioGroup Groups related items inside the parent component. **Composition and refs** - `children: Snippet<[]>` - `bind:ref: HTMLElement \| null` Inherits from [Bits UI DropdownMenu.RadioGroup](https://bits-ui.com/docs/components/dropdown-menu#radio-group). ### MenuRadioItem Renders one selectable or repeated item. **Composition and refs** - `children: Snippet<[MenuRadioItemSnippetProps]>` - `bind:ref: HTMLElement \| null` Inherits from [Bits UI DropdownMenu.RadioItem](https://bits-ui.com/docs/components/dropdown-menu#radio-item). ### MenuSeparator Visually separates related content. **Composition and refs** - `children: Snippet<[]>` - `bind:ref: HTMLElement \| null` Inherits from [Bits UI DropdownMenu.Separator](https://bits-ui.com/docs/components/dropdown-menu#separator). ### MenuShortcut Displays a keyboard shortcut hint. **Composition and refs** - `children: Snippet<[]>` Inherits from [Svelte component attributes](https://svelte.dev/docs/svelte/basic-markup#Attributes). ### MenuSub Groups nested sidebar menu content. | Prop | Type | Default | Description | | --- | --- | --- | --- | | `bind:open` | `boolean` | `false` | Open state for the popup or disclosure. Bind with `bind:open`. | **Composition and refs** - `children: Snippet<[]>` Inherits from [Bits UI DropdownMenu.Sub](https://bits-ui.com/docs/components/dropdown-menu#sub). ### MenuSubPopup Renders the floating or modal surface for the parent component. **Composition and refs** - `children: Snippet<[]>` - `bind:ref: HTMLElement \| null` Inherits from [Bits UI DropdownMenu.SubContent](https://bits-ui.com/docs/components/dropdown-menu#sub-content). ### MenuSubTrigger Renders the control that opens a submenu. **Composition and refs** - `children: Snippet<[]>` - `child: Snippet<[{ props: Record }]>` - `bind:ref: HTMLElement \| null` Inherits from [Bits UI DropdownMenu.SubTrigger](https://bits-ui.com/docs/components/dropdown-menu#sub-trigger). ### MenuTrigger Renders the control that opens, closes, or selects related content. **Composition and refs** - `children: Snippet<[]>` - `child: Snippet<[{ props: Record }]>` - `bind:ref: HTMLElement \| null` Inherits from [Bits UI DropdownMenu.Trigger](https://bits-ui.com/docs/components/dropdown-menu#trigger). ## Implementation Details | Field | Value | | --- | --- | | Status | Stable | | Foundation | compound | | Category | Overlays & Popups | | Particles | 9 | ## Status Stable for the current coss-svelte surface. ## Agent Notes - Import Svelte exports directly from `coss-svelte`. - This is Svelte 5 code: use `class`, lowercase event properties, runes, snippets, and documented `bind:*` contracts. Do not emit JSX, React hooks, `className`, `asChild`, or Base UI imports. - Prefer this route's example and generated API table over React COSS snippets; COSS React particles are design references only. - The copy-and-own registry is a preview. Inspect `/r/menu.json` for the complete local file and dependency closure. - Menu is stable in the current source catalog.