_Every part marked "common parameters" below derives from `BitBhComponentBase` and also takes these, which are not repeated per part:_ | Parameter | Type | Description | | --- | --- | --- | | `As` | `string?` | Override the rendered HTML element. Each component declares its own `BitBhComponentBase.DefaultTag` (e.g. "button") which is used when As is null. | | `Id` | `string?` | Explicit HTML id. When omitted a stable auto-generated id is used. | | `Ref` | `Action?` | Callback to capture the underlying `ElementReference` for DOM access / focus management. | | any other attribute (`class`, `style`, `data-*`, `aria-*`, `@onclick` ...) | `Dictionary?` | Captures all HTML attributes not matched by explicit parameters. These are merged onto the root element, giving consumers full control over class, style, data-*, aria-*, and any other HTML attribute. | # Menu (`menu`, Menus) An accessible dropdown menu with keyboard navigation, typeahead, and zero visual opinion. Demo pages: `/menu` (plain CSS), `/tw/menu` (Tailwind). ## BitBhMenu A headless, accessible dropdown Menu implementing the WAI-ARIA Menu Button pattern. **Key features:** - **Rich items** — `BitBhMenuItem`, `BitBhMenuCheckboxItem`, `BitBhMenuRadioGroup` / `BitBhMenuRadioItem`, groups, labels, separators. - **Nested submenus** — `BitBhMenuSub`, `BitBhMenuSubTrigger`, `BitBhMenuSubContent` with hover intent and keyboard support. - **Full keyboard support** — Enter / Space / ArrowDown / ArrowUp open; arrows, Home / End, typeahead navigate; Enter / Space activate; ArrowRight / ArrowLeft enter and leave submenus; Escape and Tab close. - **Focus management** — focus moves into the menu (items are announced via `aria-activedescendant`) and returns to the button on close. - **Dismissal** — pointer-down outside or Escape closes it; no invisible overlays, so the first outside click still reaches its target. - **Menubar ready** — place menus inside a `BitBhMenubar` for an application menu bar. - **Open on hover** — `BitBhMenu.OpenOnHover` opens it when the pointer rests on the button (menubar-style navigation) without taking the focus. - **Data attributes** — `data-state="open|closed"`; `data-active` / `data-highlighted`, `data-disabled`, `data-state="checked|unchecked"` on items. **Usage:** ```razor Options ▾ Edit Delete ``` - Renders `
` (another one with `As`); takes the common parameters. - Two-way bindable: `@bind-Open`. - Hooks its documentation names: `aria-activedescendant`, `data-state="open|closed"`, `data-active`, `data-highlighted`, `data-disabled`, `data-state="checked|unchecked"`. | Parameter | Type | Default | Description | | --- | --- | --- | --- | | `Open` | `bool` | `false` | Whether the menu is open. Supplying it makes the menu controlled (use `@bind-Open`). | | `DefaultOpen` | `bool` | `false` | Initial open state when uncontrolled. | | `OpenChanged` | `EventCallback` | - | Two-way binding callback for `BitBhMenu.Open`. | | `OnOpenChange` | `EventCallback` | - | Fires whenever the open state changes. | | `Disabled` | `bool` | `false` | Disables the entire menu. | | `Dir` | `BitBhDirection?` | `null` | Reading direction (flips submenu keys). Inherits from `BitBhDirectionProvider`. | | `OpenOnHover` | `bool` | `false` | Opens the menu when the pointer rests on its button (after `BitBhMenu.HoverOpenDelay`) and closes it when the pointer has left the button and every panel of the menu (after `BitBhMenu.HoverCloseDelay`) - Base UI's `openOnHover`, for menubar-style navigation. A hover-opened menu leaves the focus where it is: the pointer highlights its items without focusing it, and closing it gives no focus back. Enter, Space, ↓ or ↑ on the button - or, with nothing focused, one of the menu's own keys - moves the focus into it, and a click on the button keeps it open (it no longer closes when the pointer leaves). Only a mouse hovers: a touch or pen press is a click. The keyboard opens it as always. | | `HoverOpenDelay` | `int` | `100` | How long the pointer rests on the button before a hover opens the menu (ms). Default: 100. | | `HoverCloseDelay` | `int` | `300` | How long after the pointer left the button and the menu a hover-opened menu closes (ms): the grace period that lets the pointer cross the gap between them, diagonally too. Default: 300. | | `ChildContent` | `RenderFragment?` | - | Child content. Should contain an `BitBhMenuButton` and an `BitBhMenuItems`. | ## BitBhMenuButton The trigger button that opens the menu. Renders as `