Menu
Actions on the current object, sort orders and view options, in an anchored list opened by a Button.
import {
Menu,
MenuCheckboxItem,
MenuGroup,
MenuGroupLabel,
MenuItem,
MenuPopup,
MenuRadioGroup,
MenuRadioItem,
MenuSeparator,
MenuSubmenu,
MenuSubmenuTrigger,
MenuTrigger,
} from '@fairgarden/design/overlays/menu'
The trigger is a Button: an outline or text Button with a title-case label ("Sort By"), or an icon-only "…". The popup renders in a portal as a white scope that follows the page mode, whatever the trigger's ground, with a --border-size-2 --primary12 edge. It sits 8 px from the trigger, aligned to its start edge, 200 to 320 px wide and at least as wide as the trigger. Rows are 44 px at every width, with a leading slot, a sentence-case label and an optional shortcut. It opens from its trigger by the outline morph, or at once, and is hidden in print; the state it sets prints as a caption.
Use a menu for actions on the current object (more, sort, export, share, row actions), not for page navigation or form values.
Action menu
Action menu
Highlight, by pointer or keyboard, is a soft fill plus a --border-size-2-25 start-edge bar; the bar alone survives forced colors. A destructive item is red: the danger glyph ◆ and a --role-danger-text label, highlighted in the danger fill with its label ink. It still names the verb and object, so color is never the only cue. A disabled item is muted, takes no highlight and says why where it can. Submenus fly out to the end side.
No action yet.
Sort and options, on forest
Sort and options, on forest
A checked radio item shows a leading ●, and a checked checkbox item a leading ✓, in --primary12 with the label at --font-weight-6: no fill and no bar. The sort trigger shows the current value. On the forest ground the trigger takes forest's roles, while the popup keeps its white scope.
Outline morph
On by default: the trigger's focus ring grows into the popup's frame as it opens and shrinks back as it closes. Opened by pointer, where no ring shows, the trigger's own edge grows instead: an outline Button's edge, a solid Button's box in its fill, or, for a text Button, the box its focus ring draws, in its ink. A menu opened on hover opens at once, and so do submenus, which open as the pointer passes over their row, and context menus. morph={false} on Menu opens and closes it at once; see Outline Morph.
API Reference
Menu, MenuTrigger and MenuPopup
Groups the parts of a menu (Base UI Menu.Root) and wires its outline morph.
| Prop | Type | Description |
|---|---|---|
morph | | The outline morph: the trigger’s focus ring (or, opened by pointer, its
edge) grows into the popup’s frame as it opens and shrinks back as it
closes. Hover opens and submenus are instant [D205]. Instant
under reduced motion; off in forced colors and print, and wherever
|
Opens the menu. Renders a Button (§9.2): an outline or text Button
with a title-case label (“Sort By”, “Export”) [D160, D165], or an
icon-only more_horiz “…". A sort trigger shows its current value.
| Prop | Type | Description |
|---|---|---|
butted | | Butts the button against an adjacent field on its |
destructive | | Marks a destructive action (delete, remove, discard, clear): the
danger (red) roles replace the action and primary inks in every
variant [D192]. |
handle | | Associates a detached trigger with a Menu created by |
icon | | One optional functional glyph (§6.10), inline tier, FILL 0. |
iconOnly | |
|
iconPosition | | Which side of the label the glyph sits on (a |
onMedia | | Only with |
onPress | | Called on click, after |
payload | | A payload handed to the Menu’s children function when this trigger opens it. |
primary | | Primary Radix scale, from the primary roster: the outline edge, labels and focus ring. Never defaulted; omitted, it inherits the scope [D133]. |
secondary | | Secondary Radix scale: the |
size | | Fixed height: |
variant | |
|
children | | The label: verb plus object, authored in title case [D160]. |
The popup, rendered through its Base UI Portal as a nested white
scope: --primary1 face, --border-size-2 --primary12 edge, --radius-2–25,
--size-px-1 padding, 200 px to --size-px-14 wide and at least the
trigger’s width, --size-px-2 from the trigger, aligned to its start
edge. It opens from its trigger by the outline morph, or at once [D205].
Inside a MenuSubmenu it flies out to the end side.
| Prop | Type | Description |
|---|---|---|
primary | | Primary Radix scale inside the popup’s |
secondary | | Secondary Radix scale inside the popup. It drives nothing but a destructive item’s fallback. |
container | | The element the portal renders into. Default: |
align | | Alignment to the trigger. Default |
alignOffset | | Offset along the alignment axis in px. |
side | | Side of the trigger. Default |
sideOffset | | Distance from the trigger in px. Default 8 ( |
collisionPadding | | Clearance from the viewport edge in px before the popup shifts or flips. Default 16. |
keepMounted | | Keeps the portal mounted while closed. |
MenuItem
An action row (Base UI Menu.Item): --fgd-size-hit tall at every
breakpoint, a --size-px-5 leading slot, the label in type-body-ui
sentence case, and an optional trailing shortcut. Highlight (pointer or
keyboard) is the --primary4 fill plus the start-edge bar (the danger fill
on a destructive item [D192]); activation closes the menu.
| Prop | Type | Description |
|---|---|---|
destructive | | A destructive action (delete, remove, clear): the danger glyph (◆ with
its inner ×) in the leading slot, the label in --role-danger-text, and
a highlight in the danger fill with --role-danger-label [D192]. The
label still names the verb and object (“Delete note”), so color is
never the only cue. Default |
icon | | A leading Material Symbols glyph at the inline tier (§6.10). |
secondary | | The item’s secondary scale. Omitted, a destructive item takes the danger scale [D129]. |
shortcut | | A trailing keyboard shortcut, in |
MenuCheckboxItem, MenuRadioGroup and MenuRadioItem
An option that toggles (Base UI Menu.CheckboxItem). Checked shows a leading ✓ in --primary12 and sets the label at --font-weight-6, with no fill and no bar [D145]. It stays open on activation.
Groups radio items into one choice, such as a sort order (Base UI Menu.RadioGroup).
One choice in a MenuRadioGroup (Base UI Menu.RadioItem). Checked shows a
leading ● in --primary12 (the FILL 1 circle, always with the weight
change) and the label at --font-weight-6; no fill and no bar [D145, D166].
MenuGroup, MenuGroupLabel and MenuSeparator
Groups related items under a MenuGroupLabel (Base UI Menu.Group).
A group’s label, in type-label --role-muted; not focusable (Base UI Menu.GroupLabel).
A full-width --border-size-1 --role-rule between groups, --size-px-1 above and below.
MenuSubmenu and MenuSubmenuTrigger
Groups a submenu’s trigger and popup (Base UI Menu.SubmenuRoot). The nested MenuPopup flies out to the end side at --size-px-2 and flips at the viewport edge and opens at once: the outline morph stays with the top-level menu [D204].
The row that opens a submenu (Base UI Menu.SubmenuTrigger), with a
trailing chevron_right at the inline tier. It stays highlighted while
its submenu is open.
| Prop | Type | Description |
|---|---|---|
icon | | A leading Material Symbols glyph at the inline tier (§6.10). |
Additional types
menu
MenuCheckboxItemProps
MenuGroupLabelProps
MenuGroupProps
menuItem
MenuItemProps
MenuPopupProps
MenuProps
MenuRadioGroupProps
MenuRadioItemProps
MenuSeparatorProps
MenuSubmenuProps
MenuSubmenuTriggerProps
MenuTriggerProps
Specification: DESIGN-SYSTEM.md §9.7 (menu), §9.1 (overlay panels) and §1.11.4 (list-option states).