ELFBAR

Menu

Popup list for contextual actions or navigation options.

Anatomy

┌─── Menu Container (283 px) ───────────────────┐
│  Group Label                                   │  ← 32 px
├───────────────────────────────────────────────│
│  📋  Menu Item 1                               │  ← 42 px
│  ✅  Menu Item 2 (checked)                     │
│  Menu Item 3 (active state)                    │
├───────────────────────────────────────────────│  ← Divider
│  ⚠️  Danger Action (error color)              │
└───────────────────────────────────────────────┘
  1. Container — Width ≈ 283 px, with radius --ds-radius-md and floating shadow
  2. Section Label — 32 px tall, identifying functional groups
  3. Menu Item — Fixed 42 px tall, 275 px wide
  4. Icon — Optional, placed to the left of text
  5. Divider — Separates different groups

Usage Guidelines

✅ Do

  • Group items by frequency of use or logical relationship
  • Place destructive actions (delete, logout, etc.) in the last group using Error color style
  • Use dividers to separate functional groups for better readability
  • Icons aid recognition — keep icon style consistent within a group (all or none)

❌ Don't

  • Keep a single group to ≤ 7 items, total groups ≤ 3 — excessive items make the menu too long
  • Don't use menus for complex form operations
  • Don't mix icon and non-icon items within the same menu
  • Don't nest more than 2 levels of submenus — deep nesting is hard to navigate

Interaction Behavior

StateDescription
DefaultWhite background, normal text color
HoverBackground highlights to --ds-color-background-tertiary
ActivatedBackground --ds-color-brand-accent1-background, text --ds-color-brand-accent1-default
DisabledText grays out, pointer-events: none
Keyboard navigation↑↓ move focus; → expand submenu; ← / Escape close; Enter/Space trigger

Accessibility

RequirementImplementation
Menu containerrole="menu"
Menu itemsrole="menuitem"
Checkbox menu itemrole="menuitemcheckbox" + aria-checked
Active itemaria-current="true"
Disabled itemaria-disabled="true"
Submenuaria-haspopup="menu" + aria-expanded
Focus managementFocus moves to first item on open; returns to trigger on close