ui

Menu

A list of actions in a dropdown, enhanced with keyboard navigation. Built with Base UI and Tailwind CSS. Copy-paste ready.

API Reference

Installation

Usage

Examples

Open on Hover

The menu popup opens when the trigger is hovered rather than clicked, useful for navigation bars and toolbars.

With Checkbox

Uses MenuCheckboxItem to let users toggle individual options on or off within a persistent menu.

With Switch

MenuCheckboxItem supports a variant="switch" prop that displays a decorative switch indicator instead of a checkmark. This is a purely visual variant - the component remains a checkbox item with the same functionality.

With Radio Group

Uses MenuRadioGroup and MenuRadioItem to enforce single selection among a set of mutually exclusive options.

Renders MenuItem elements as anchor tags for navigating to routes directly from the menu popup.

With Group Label

Organizes menu items into labeled sections using MenuGroup and MenuGroupLabel for better scanability.

Nested Menu

Opens a MenuSub popup from a parent item to reveal a secondary list of options without closing the parent menu.

Close on Click

Demonstrates controlling closeOnClick behavior so the menu dismisses immediately when an item is selected.

Open a Dialog

Triggers a Dialog from a MenuItem, allowing secondary confirmation flows to be launched directly from a menu.

Account Menu

A circular avatar trigger with user info in the MenuGroupLabel header, account links, and a destructive "Sign out" item at the bottom.

File Actions

A labeled "File actions" trigger grouping rename, duplicate, move, and download items with keyboard shortcuts, plus a destructive delete at the bottom.

Icon Button Trigger

A compact size="icon" ghost button (⋮) as the trigger — a common pattern for per-row action menus in lists and tables.

Notification Settings

A bell icon trigger that opens a menu mixing variant="switch" channel toggles with standard checkbox activity options in separate groups.

Share with Export Sub-menu

A "Share" button trigger offering a copy link item alongside an "Export as" MenuSub with format choices (PDF, PNG, SVG, CSV).