bit Bheadless

Menu

An accessible dropdown menu with keyboard navigation, typeahead, and zero visual opinion.

Implementation: CSS Tailwind

Basic Menu

Click the button or press Space / Enter / arrow keys to open. Use Up / Down to navigate, Home / End to jump, Enter / Space to activate, Escape to close. Type a letter to jump to the first matching item. ARIA wiring (aria-haspopup="menu", aria-expanded, aria-activedescendant) is handled automatically.

Last action: (none)

Disabled Items

Set Disabled="true" on individual items. Disabled items receive data-disabled for CSS, are skipped by arrow-key nav, and are ignored by typeahead.

Last action: (none)

Rich item content

Items can contain any markup. Use the data-active hook to drive the highlighted style and provide a Label string so typeahead still works when the content is rich.

Last action: (none)

Sections and dividers

Group related items with a plain <li> divider or a section heading. These are regular HTML elements โ€” the menu component doesn't need to know about them.

Last action: (none)

Anchor Positioning

Set Anchor on BitBhMenuItems to automatically position the dropdown relative to the button. The panel uses position: fixed and auto-updates on scroll/resize. It flips to the opposite side if there's not enough space, and shifts to stay within the viewport. CSS custom properties --button-width, --anchor-gap are exposed on the panel.

Last action: (none)

Polymorphic items

Set As="a" on an item to render it as an anchor tag โ€” useful for navigation links inside a menu. The item still participates in keyboard nav and receives all the ARIA attributes.

An unhandled error has occurred. Reload ๐Ÿ—™