Skip to content

Menu

Stable

A button that opens a list of actions, with full keyboard support.

Also known as dropdown menu, context menu, action menu, overflow menu

Install with npm install @tattva/ui (setup), or copy the code from the kit in Downloads.

Icon-only trigger

Last choice: Nothing yet

triggerLabel gives the icon button its name. The menu opens below and lines up with the start of the button.

When to use it

Holds actions that would crowd the screen, such as Rename, Share and Delete. Choosing an item runs it and closes the menu.

Made of: Trigger button · Menu panel · Group label · Item · Icon · Shortcut · Separator

Use it for

  • A More actions button on a card or message.
  • A short list of related actions behind one button.
  • Actions with shortcuts, a dangerous action set apart at the bottom.

Not for

  • Panels with forms, text or other controls: use Popover.
  • Choosing one value that stays selected: use SegmentedControl.
  • The one main action on a screen: use Button.

Do and avoid

Rename
Share
Delete trip
Do. Extra actions tucked away, and the risky one says what it does.
Save
Cancel
Avoid. Hiding just two choices in a menu adds a needless extra tap.

Do

  • Keep the list short, and put the most used items first.
  • Put dangerous actions last, after a separator.
  • Use verbs for labels, such as Rename and Export.
  • Confirm a destructive action in a follow-up step if it cannot be undone.

Avoid

  • Do not put forms, long text or other controls in a menu. Use a Popover.
  • Do not use a menu for two choices. Show two buttons.
  • Do not rely on red alone. A danger item must say what it does.
  • Do not nest menus inside menus.

On a phone

  • On a phone the menu opens as a bottom sheet with a backdrop, in reach of the thumb; set phoneSheet to false to keep it anchored to the trigger.
  • The trigger and every item are at least 44px tall on touch screens.
  • Keyboard shortcuts shown beside items are hints for keyboards, so do not make an action available only through a shortcut.

Build your next AI screen with Tattva.

Free and open, with the code. Start in one line.

Get started