bit Bheadless

Context Menu

A menu located at the pointer, triggered by a right click. Keyboard navigation, typeahead, and viewport collision handling included.

Implementation: CSS Tailwind

Basic Context Menu

Right-click the trigger area to open the menu at the pointer. Use Up / Down to navigate, Home / End to jump, Enter / Space to activate, Escape to close, and type a letter to jump to the first matching item. The native browser menu is suppressed on the trigger.

Right-click here
Last action: (none)

Labels, groups and separators

Use BitBhContextMenuLabel to title a section, BitBhContextMenuGroup to relate items for assistive tech, and BitBhContextMenuSeparator to draw a divider. Labels and separators are skipped by keyboard nav and typeahead.

Right-click for a structured menu
Last action: (none)

Disabled menu

Set Disabled="true" on BitBhContextMenu to turn the whole thing off. The trigger then lets the native browser context menu through instead.

Right-click here (disabled — native menu shows)
An unhandled error has occurred. Reload 🗙