# `src/components/dropdown/DropdownMenu.ts`:

## class: `DropdownMenu`, `btu-dropdown-menu`

### Superclass

| Name         | Module | Package |
| ------------ | ------ | ------- |
| `LitElement` |        | lit     |

### Mixins

| Name                  | Module                           | Package |
| --------------------- | -------------------------------- | ------- |
| `RovingTabindexMixin` | /src/util/RovingTabindexMixin.js |         |
| `EventEmitterMixin`   | /src/util/EventEmitterMixin.js   |         |
| `ReadyMixin`          | /src/util/ReadyMixin.js          |         |

### Fields

| Name           | Privacy | Type      | Default                | Description                                                            | Inherited From |
| -------------- | ------- | --------- | ---------------------- | ---------------------------------------------------------------------- | -------------- |
| `name`         |         | `string`  | `''`                   | Accessible name for the menu, displayed in header when header is true. |                |
| `header`       |         | `boolean` | `false`                | Show header bar with menu name.                                        |                |
| `checkbox`     |         | `boolean` | `false`                | Enable checkbox mode for items (menuitemcheckbox role).                |                |
| `icon`         |         | `boolean` | `false`                | Show icons before each item.                                           |                |
| `symbol`       |         | `string`  | `''`                   | Fallback Lucide icon symbol for items without their own.               |                |
| `favorites`    |         | `boolean` | `false`                | Show favorite toggle on each item.                                     |                |
| `shortcuts`    |         | `boolean` | `false`                | Show keyboard shortcut text on each item.                              |                |
| `emptyMessage` |         | `string`  | `'No items available'` | Message displayed when the menu has no focusable items.                |                |
| `_isEmpty`     | private | `boolean` |                        | Check whether the menu has zero focusable items                        |                |

### Methods

| Name                 | Privacy | Description                                                                                                                                                                                                                                                                        | Parameters                                              | Return           | Inherited From    |
| -------------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------- | ---------------- | ----------------- |
| `_configureItems`    | private | Configure all child items with menu-level settings                                                                                                                                                                                                                                 |                                                         | `void`           |                   |
| `_getAllItems`       | private | Get all btu-dropdown-item children                                                                                                                                                                                                                                                 |                                                         | `DropdownItem[]` |                   |
| `_getFocusableItems` | private | Get only focusable items (default type, skip dividers/subheads)                                                                                                                                                                                                                    |                                                         | `DropdownItem[]` |                   |
| `_handleTypeahead`   | private | Typeahead character matching with 500ms accumulation                                                                                                                                                                                                                               | `char: string, focusable: DropdownItem[]`               | `void`           |                   |
| `emit`               |         | Dispatches a type-safe CustomEvent with standardized configuration.&#xA;&#xA;All events are configured with:&#xA;- bubbles: true (event propagates up the DOM tree)&#xA;- cancelable: false (event cannot be cancelled)&#xA;- composed: true (event crosses shadow DOM boundaries) | `type: K, detail: UnpackCustomEvent<CustomEventMap[K]>` | `boolean`        | EventEmitterMixin |

### Events

| Name                      | Type          | Description              | Inherited From |
| ------------------------- | ------------- | ------------------------ | -------------- |
| `btu-dropdown-menu-ready` | `CustomEvent` | Fired after first render |                |

### Attributes

| Name            | Field        | Inherited From |
| --------------- | ------------ | -------------- |
| `name`          | name         |                |
| `header`        | header       |                |
| `checkbox`      | checkbox     |                |
| `icon`          | icon         |                |
| `symbol`        | symbol       |                |
| `favorites`     | favorites    |                |
| `shortcuts`     | shortcuts    |                |
| `empty-message` | emptyMessage |                |

### CSS Properties

| Name                     | Default | Description                                |
| ------------------------ | ------- | ------------------------------------------ |
| `--dropdown-empty-color` |         | Empty state text color (default: gray-400) |

### Slots

| Name | Description                                 |
| ---- | ------------------------------------------- |
|      | Menu items (\`btu-dropdown-item\` elements) |

<hr/>

## Exports

| Kind                        | Name                | Declaration  | Module                                  | Package |
| --------------------------- | ------------------- | ------------ | --------------------------------------- | ------- |
| `js`                        | `default`           | DropdownMenu | src/components/dropdown/DropdownMenu.ts |         |
| `custom-element-definition` | `btu-dropdown-menu` | DropdownMenu | src/components/dropdown/DropdownMenu.ts |         |
