Componentsv2.189.1
Iconsv1.19.0
MCPv0.8.62
Tokensv0.34.3

A set of actions in a popover.

Anatomy

  1. Menu: Wrapper than houses menu items. Positioned relative to the trigger.
  2. Menu item: Single action or link within the menu. May include an icon, description, or tooltip for added context.

Guidelines

When to use

DropdownMenus display a list of actions or links as menu items in a floating overlay when its trigger is activated. DropdownMenus are best used to cleanly group actions together within a specific context, such as row-level actions inside a table or account settings.

DropdownMenus, Selects, and Popovers similarly offer a floating overlay of content for the user to choose or interact with. It's important to be mindful about the differences as they are not interchangeable:

  • DropdownMenus trigger actions or navigation. Selecting an item performs an operation (e.g. delete, edit, navigate) and closes the menu.
  • Selects are form controls for choosing values. The selected option persists as the field's value and is submitted with the form.
  • Popovers display freeform content such as text, forms, or other UI elements that are too complex for a Tooltip.

Best practices

Icons

Icons provide nice, helpful visual treatments to menu items. Be consistent about icon usage, especially within groups. If one menu item includes an icon, add icons for the remaining items so visual alignment is consistent.

Do: Apply icons consistently within each group.
Don't: Mix icon and non-icon items in the same group.

Shorter menus make for a more focused user experience. If the DropdownMenu's list grows to more than 7-10 items, consider grouping them if possible to reduce cognitive load.

Do: Categorize longer lists under labels to reduce cognitive load.
Don't: Display a longer list of ungrouped menu items.

Nesting

Limit nested menu items to one sub-level. Deeply nested menus are difficult to navigate with both mouse and keyboard, and may potentially obscure both available actions and surrounding content. Consider revising the menu structure or using labels to categorize items.

Don't: Nest submenus more than one level deep. Reorganize the menu structure or use a different pattern instead.

Appearance

The footer is displayed after all items and is used for additional information or hints relating to the entire list.

Footer

A footer anchored below the menu items provides supplemental list context.

Groups

Group related items into visually distinct sections separated by a divider. A group may include a label that displays above the items it categorizes. Unlabeled groups are only denoted by the divider.

Use groups wisely. Groups help organize longer lists. For shorter lists, group actions together if the user experience or visual hierarchy is improved.

Labeled groups

Group headers categorize items and help users scan the menu quickly.

Unlabeled groups

Groups without a label render a divider to visually separate sections.

Item variations

DropdownMenu items support several configurations to visually aid users in selecting the most appropriate item.

Icon

Icons help users quickly identify actions they may take.

Description

A description provides additional information about the item.

Danger

Danger styling warns users that an action is destructive or irreversible.

Trigger styles

The DropdownMenu supports multiple trigger styles depending on the context.

Base

The base trigger renders as inline text that inherits surrounding text styles.

Icon-only button

Icon-only buttons are commonly used in tighter components or layouts such tables or toolbars.

Trigger button

Standard Pluma Buttons may be used as the trigger.

Custom trigger

Custom triggers can be created with any interactive to fulfill different use cases.

Behaviors

States

Base

The menu item's rest state uses base styling.

Hover

A menu item's background color changes on mouse hover.

Focus

Keyboard focus applies the same background highlight as hover.

Disabled

Disabled items are visually dimmed and cannot be interacted with.

Danger

Danger items receive the critical color styling to denote destructive actions.

Checkbox items

Checkbox items allow users to toggle options within the menu. They display a check indicator when selected and are ideal for multi-select use cases such as toggling column visibility or enabling filters.

Checkbox items

Checkbox items display a check icon to indicate it's selected.

Dismissal

DropdownMenus close when the user clicks an item, clicks outside the menu, or presses the Escape key. Focus returns to the trigger after the menu closes.

Individual items can be configured to keep the menu open when clicked. This is useful when multiple items may need to be selectable or toggled before the menu is dismissed.

Open on click

Items can be manually set to keep the menu open even when clicked.

Nested menus

DropdownMenu items can be nested within a parent item to organize hierarchical actions or options. Nested items are denoted with a trailing icon. Hovering the parent with the mouse or activating it with a keyboard will reveal the nested menu.

Nested menu

Trailing chevron icons indicate an item has a nested menu that is revealed on hover or keyboard activation.

Placement

The menu content is positioned relative to the trigger. The default placement is bottom-start, which aligns the menu's left edge with the trigger and opens downward. Use other placements to adapt to layout constraints or reading direction.

Be mindful that placement is a preference, not a guarantee. The menu will adjust to the layout accordingly to ensure it's visible within the viewport when possible. When outside of the viewport, the menu will disappear.

Bottom start

The menu opens below the trigger, aligned to its leading edge. This is default.

Bottom end

The menu opens below the trigger, aligned to its trailing edge. Suitable for triggers positioned near the right edge of a container.

Top start

The menu opens above the trigger. Used when the trigger is near the bottom of the viewport or when content below may be obscured.

Right start

The menu opens to the right of the trigger. Suitable for sidebar or navigational contexts.

Tooltips

Tooltips are another avenue to provide additional context to specific items within the menu. Tooltips may be particularly helpful to explain to users why an item may be disabled.

Tooltips

Tooltips explain why an action is unavailable, helping users understand what would make it available.

Content

Descriptions

Descriptions provide helpful context to the items they describe, such as what action the item performs or when to use it. They're best written as a single, simple sentence.

Do: Use descriptions to clarify what the action does.
Don't: Repeat the label or add a vague, unhelpful description.

Group labels

Group labels are single nouns written in uppercase that best describes the category of items it's associated with. Keep labels as brief as possible.

Do: Use descriptive, but concise category labels.

Use short, specific verb phrases that describe what happens when the item is selected. Sentence case is preferred.

Do: Start with a verb that describes the action that will take place.
Don't: Use vague or generic labels that don't describe the action.

Tooltip text

When using tooltips on disabled items, explain the reason the item is unavailable and, when possible, what the user can do to enable it.

Do: Explain why the action is unavailable and what would enable it.
Don't: Repeat the disabled state without explanation.