Skip to content

Menu

A floating list of commands — items, labels, separators, a checked choice, a two-line item — for a dropdown, a context menu or an overflow menu.

  • .aparte-menu
On this page
Open

.aparte-menu is the surface a dropdown, a context menu or a ⋯ menu is drawn on: a bordered, raised column of __item rows, with __label headings and __separator lines between groups. A two-line item wraps its name and a __description in a __body. The conversation list’s row menu is this recipe.

The check mark is drawn for you: an item with aria-checked (a menuitemradio or menuitemcheckbox) gets a gutter, and the mark shows when the value is "true". Do not add a check of your own.

Where the menu sits, and opening and closing it, are yours: there is no positioning here.

VariableDefault
--aparte-menu-shadow0 4px 12px rgba(0, 0, 0, 0.1)
--aparte-menu-max-width—
--aparte-menu-min-width—

.aparte-menu · .aparte-menu__body · .aparte-menu__description · .aparte-menu__item · .aparte-menu__label · .aparte-menu__separator

  • Use role="menu" and role="menuitem" (or menuitemradio / menuitemcheckbox with aria-checked) on real buttons, and role="separator" between groups.
  • The button that opens the menu takes aria-haspopup="menu" and aria-expanded; the arrow keys between items and Escape to close are your script’s.
  • Popover — a floating box for anything that is not a list of commands.
  • Select — a list that holds a value.