Getting startedComponentsDesign tokensThemingTheme synthesizerFrameworksAccessibilityUtilitiesServer renderingBrowser supportContributingChangelogApp ShellAspect GridAuth ShellCenterContainerDashboard GridFloat BarInsetMasonryPage HeaderPage LayoutResizableResponsive SwitcherSectionSettings LayoutSplit PaneStatus BarStickyToolbarAnchor NavBottom NavBreadcrumbBreadcrumb MenuCommand BarDrawerFooterLinkMenubarNavigation MenuPage IndicatorPaginationRailScroll IndicatorScroll SpyScroll To TopSidebarSkip LinkStepper NavTabsTop BarTree ViewAccordionAspect RatioAvatarAvatar GroupCardCarouselCollapsibleColor SwatchCTA BannerDividerEmpty StateFeature CardIconImageImage CompareImage HotspotsInfinite ScrollLightboxMarqueeQR CodeScroll AreaSkeletonSpinnerStackVideoVirtual ListActivity HeatmapAnimated NumberBadgeBar ListChartClockComparisonCountdown TimerData GridDescription ListDiffGaugeJSON TreeKanbanLevel MeterListMeterSparklineStatStepperTagTimelineUptimeValue CardWaveformBlockquoteCode BlockCode GroupGradient TextHighlightKbdKeyboard MapMarkdownNumber FormatProseTerminalTextTime AgoTruncateTypewriterButtonButton GroupCalendarCheckboxChipColor PickerComboboxCopy ButtonDate PickerDate Range PickerField ListFieldsetFile UploadFormHotkeyIcon ButtonImage CropperInline EditInputInput GroupKnobLabelMasked InputMulti SelectNumber InputPassword InputPin InputRadio GroupRange SliderRatingSearchSegmented ControlSelectSignature PadSliderSortable ListSwitch GroupTag InputTextareaTheme ToggleTime PickerToggleTransfer ListTree SelectAlertAnnouncementBannerCommand PaletteConfirmConnection StatusContext MenuConversationDialogDropdown MenuHover CardLoading OverlayNotification PanelPopoverProgressSheetToastTooltip
ARC UIARC Radiant Components
v4.9DocsComponentsTokensSynthesizer
Getting startedFrameworksServer renderingDesign tokensThemingTheme synthesizerTypographyUtilitiesAll componentsAccessibilityBrowser supportChangelogContributingStatsApp ShellAspect GridAuth ShellCenterContainerDashboard GridFloat BarInsetMasonryPage HeaderPage LayoutResizableResponsive SwitcherSectionSettings LayoutSplit PaneStatus BarStickyToolbarAnchor NavBottom NavBreadcrumbBreadcrumb MenuCommand BarDrawerFooterLinkMenubarNavigation MenuPage IndicatorPaginationRailScroll IndicatorScroll SpyScroll To TopSidebarSkip LinkStepper NavTabsTop BarTree ViewAccordionAspect RatioAvatarAvatar GroupCardCarouselCollapsibleColor SwatchCTA BannerDividerEmpty StateFeature CardIconImageImage CompareImage HotspotsInfinite ScrollLightboxMarqueeQR CodeScroll AreaSkeletonSpinnerStackVideoVirtual ListActivity HeatmapAnimated NumberBadgeBar ListChartClockComparisonCountdown TimerData GridDescription ListDiffGaugeJSON TreeKanbanLevel MeterListMeterSparklineStatStepperTagTimelineUptimeValue CardWaveformBlockquoteCode BlockCode GroupGradient TextHighlightKbdKeyboard MapMarkdownNumber FormatProseTerminalTextTime AgoTruncateTypewriterButtonButton GroupCalendarCheckboxChipColor PickerComboboxCopy ButtonDate PickerDate Range PickerField ListFieldsetFile UploadFormHotkeyIcon ButtonImage CropperInline EditInputInput GroupKnobLabelMasked InputMulti SelectNumber InputPassword InputPin InputRadio GroupRange SliderRatingSearchSegmented ControlSelectSignature PadSliderSortable ListSwitch GroupTag InputTextareaTheme ToggleTime PickerToggleTransfer ListTree SelectAlertAnnouncementBannerCommand PaletteConfirmConnection StatusContext MenuConversationDialogDropdown MenuHover CardLoading OverlayNotification PanelPopoverProgressSheetToastTooltip

Dropdown Menu

A menu of actions that opens from a button.

ComponentsDropdown Menu
feedbackinteractive
<arc-dropdown-menu>

Overview

DropdownMenu opens a menu from the element in its `trigger` slot, which can be an `<arc-button>`, a plain `<button>` or an icon button. Items are `<arc-menu-item>` children with a label and an optional `shortcut` hint, `<arc-menu-divider>` separates groups, and `<arc-menu-label>` names the group after it. Clicking the trigger toggles the menu. A click outside or Escape closes it. Arrow Down and Arrow Up move through the items, skipping dividers and disabled items, Home and End jump to the ends, and Enter chooses. Choosing fires `arc-select` with the item's `value`, or its label if it has none, then closes the menu. Every close fires a cancelable `arc-close`, and focus returns to where it was when the menu opened, unless a click outside closed it. Use it for action menus on a button: a file menu, a "more actions" button or a profile menu. ContextMenu opens on right-click instead, and Select is a form control that keeps a value.

Guidelines

Do

  • Make the trigger say what's in the menu, such as an "Actions" button or a recognizable icon
  • Name groups with `<arc-menu-label>`, not with a disabled item
  • Show shortcut hints on items that also have a key binding
  • Give items a `value` when two of them could share a label
  • Move long lists of commands to a CommandPalette

Don't

  • Don't use it in place of a Select. It doesn't keep a selected value
  • Don't put the trigger outside the component. It has to be in the `trigger` slot
  • Don't nest a DropdownMenu inside a menu item. There are no submenus
  • Don't add `role="menu"` or `role="menuitem"` yourself

Features

  • The menu renders in the top layer and flips above the trigger when there's no room below
  • Disabled items are muted and can't be chosen
  • The trigger is shrink-to-fit. Give the host a width, or `display: block`, and the trigger fills it
  • The trigger gets `aria-haspopup` and `aria-expanded`, and the component sets `role="menu"` and `role="menuitem"`
  • The `arc-select` detail also has `index`, and an `item` object with the item's `label`, `shortcut` and `value`

Preview

Actions Danger zone

Usage

This component needs JavaScript. Use the Web Component or a framework wrapper.

<arc-dropdown-menu>
  <button slot="trigger">File Menu</button>
  <arc-menu-item shortcut="⌘N">New File</arc-menu-item>
  <arc-menu-item shortcut="⌘O">Open</arc-menu-item>
  <arc-menu-item shortcut="⌘S">Save</arc-menu-item>
</arc-dropdown-menu>

API

openbooleanfalse
Controls whether the menu panel is visible. Toggled by clicking the trigger. Set to false when the user selects an item, clicks outside, or presses Escape.

Events

arc-close
Fired when the dropdown closes
arc-select
Fired when a menu item is selected

MenuItem

<arc-menu-item>

One action in the menu. Its label is the `label` attribute or, without one, its text content.

displayLabel
The text to draw. label was documented as a prop and implemented as a getter over textContent with no setter and no attribute, so <arc-menu-item label="Cut"></arc-menu-item> rendered a blank item, silently, and the six generated wrappers exposed a writable label that did nothing (finding #32). It is a real property now; the text-content form stays the fallback, so every existing consumer is unaffected.
selectionValue
What arc-select reports. Falls back to the label so an item that never sets value behaves as it always did.
labelstring''
Display text for the menu item. Settable, and falls back to the element's text content when unset: <arc-menu-item label="Cut"> and <arc-menu-item>Cut</arc-menu-item> are equivalent.
shortcutstring''
Keyboard shortcut hint displayed on the right side.
iconstring''
Name of the icon to display before the label.
valuestring''
Stable identifier carried on the arc-select detail. Defaults to the label, which is fine until two items share one. Give anything a handler must act on its own value rather than matching against display text.
disabledbooleanfalse
Disables the item, preventing interaction.

MenuDivider

<arc-menu-divider>

A line between groups of menu items.

MenuLabel

<arc-menu-label>

A heading over a group of menu items. The items after it, up to the next label, form one named group.

displayLabel
labelstring''
The heading text. Falls back to the element's text content when unset, as on arc-menu-item.

See also