Menu

Commands, with checkbox and radio items, groups, separators, and submenus.

Installation

Examples

Default

A menu runs commands, such as a row's actions. For settings that stay open while they change, use a Popover. These menus open over a card, so they take raised, which lifts them a level more.

demo.tsx

Shortcuts

shortcut, written as Mod Z, shows a command's keys at the end of its item.

shortcuts.tsx

A Submenu opens beside its SubmenuTrigger, with its first item level with the trigger.

submenu.tsx

Checkbox items

A MenuCheckboxItem turns a setting on and off and keeps the menu open. Its check holds a column at the start whether it shows or not, so the items' text lines up.

checkbox-items.tsx

Radio items

A MenuRadioGroup chooses one of its MenuRadioItems, checked the same way.

radio-items.tsx

Groups

A MenuGroupLabel names the items of a MenuGroup, or of a MenuRadioGroup, and the keyboard skips it.

groups.tsx

Disabled items

disabled dims an item that can't run yet; the keyboard still reaches it.

disabled.tsx

Anatomy

Each part's data-slot, which a theme styles, is beside it.