Dropdown Menu
Displays a menu to the user (such as a set of actions or functions), triggered by a button. Built on top of Radix Dropdown Menu.
Layering and z-index
DropdownMenu.Content and DropdownMenu.SubContent render at Tailwind z-50, Mantle's float tier. When composed inside an open Dialog, AlertDialog, or Sheet, they portal into that overlay's positioner and paint above the overlay that owns them. Outside every overlay, they portal to document.body, below the overlay tier (z-60). When sibling floats share a container, the most recently mounted float paints on top.
DropdownMenu does not render a backdrop by default. Modal layers such as Dialog, Sheet, and AlertDialog do render backdrops, so stacking those layers compounds the dim and blur effect on the layers underneath.
Composition
Compose the parts of a DropdownMenu together to build your own:
Polymorphism
asChild renders the part's single child instead of its default element, and forwards class names, data-*
attributes, and ref onto that child. These parts take it:
DropdownMenu.SubTrigger, DropdownMenu.CheckboxItem, and DropdownMenu.RadioItem each render a second
element beside your children: the submenu caret, or the check indicator. Under asChild, Radix clones your
single child as the item element and moves the label span and that element inside it, so the
translation guarantee holds on both paths.
API Reference
The DropdownMenu components are built on top of Radix Dropdown Menu.
DropdownMenu.Root
The root, stateful component that manages the open/closed state of the dropdown menu.
DropdownMenu.Content and DropdownMenu.SubContent render at Tailwind z-50, Mantle's float tier. When composed inside an open Dialog, AlertDialog, or Sheet, they portal into that overlay's positioner and paint above the overlay that owns them. Outside every overlay, they portal to document.body, below the overlay tier (z-60). When sibling floats share a container, the most recently mounted float paints on top.
DropdownMenu.Trigger
The trigger button that opens the dropdown menu.
DropdownMenu.Content
The container for the dropdown menu content. Appears in a portal with scrolling and animations.
DropdownMenu.Content and DropdownMenu.SubContent render at Tailwind z-50, Mantle's float tier. When composed inside an open Dialog, AlertDialog, or Sheet, they portal into that overlay's positioner and paint above the overlay that owns them. Outside every overlay, they portal to document.body, below the overlay tier (z-60). When sibling floats share a container, the most recently mounted float paints on top.
All props from Radix DropdownMenu.Content, plus:
DropdownMenu.Item
A standard item in the dropdown menu that can be selected or activated.
DropdownMenu.CheckboxItem
A menu item with a checkbox that can be controlled or uncontrolled.
children render inside a <span data-slot="dropdown-menu-checkbox-item-label">. The check indicator is a permanent element sibling, so without the span a bare text label is never a lone child: a browser translation engine reparents that text node, and the removal React runs when the label changes shape or goes away throws. The span is display: contents, so an icon and its label stay flex items of the item and keep its gap. Browser translation covers the mechanism and the rules your own components need.
An icon you pass as a child is now a grandchild of the item, so a [&>svg] class of your own no longer reaches it. Match the part's own variant instead: [&>[data-slot=dropdown-menu-checkbox-item-label]>svg]:size-4. A [&_svg] class or a class on the icon itself loses to the item's default, which carries one more attribute selector.
All props from Radix DropdownMenu.CheckboxItem, including:
Data attributes
DropdownMenu.RadioGroup
A radio group container for exclusive selection within the dropdown menu.
DropdownMenu.RadioItem
A radio item where only one item in the group can be selected at a time.
children render inside a <span data-slot="dropdown-menu-radio-item-label">. The check indicator is a permanent element sibling, so without the span a bare text label is never a lone child: a browser translation engine reparents that text node, and the removal React runs when the label changes shape or goes away throws. The span is display: contents, so an icon and its label stay flex items of the item and keep its gap. Browser translation covers the mechanism and the rules your own components need.
An icon you pass as a child is now a grandchild of the item, so a [&>svg] class of your own no longer reaches it. Match the part's own variant instead: [&>[data-slot=dropdown-menu-radio-item-label]>svg]:size-4. A [&_svg] class or a class on the icon itself loses to the item's default, which carries one more attribute selector.
All props from Radix DropdownMenu.RadioItem, including:
Data attributes
DropdownMenu.Label
A label for grouping and describing sections within the dropdown menu.
DropdownMenu.Group
A group container for organizing related dropdown menu items. Accepts all props from Radix DropdownMenu.Group.
DropdownMenu.Separator
A visual separator for dividing sections within the dropdown menu. All props from Separator.
DropdownMenu.Shortcut
A keyboard shortcut indicator for dropdown menu items. It locks translate="no", because a translated key name names the wrong key. All props from span except translate.
DropdownMenu.Sub
A submenu container for creating nested dropdown menus. Accepts all props from Radix DropdownMenu.Sub.
DropdownMenu.SubTrigger
A trigger for a dropdown menu sub-menu. It opens the submenu on hover, or on ArrowRight or Enter.
children render inside a <span data-slot="dropdown-menu-sub-trigger-label">. The caret is a permanent element sibling, so without the span a bare text label is never a lone child: a browser translation engine reparents that text node, and the removal React runs when the label changes shape or goes away throws. The span is display: contents, so an icon and its label stay flex items of the item and keep its gap. Browser translation covers the mechanism and the rules your own components need.
An icon you pass as a child is now a grandchild of the item, so a [&>svg] class of your own no longer reaches it. Match the part's own variant instead: [&>[data-slot=dropdown-menu-sub-trigger-label]>svg]:size-4. A [&_svg] class or a class on the icon itself loses to the item's default, which carries one more attribute selector.
Data attributes
DropdownMenu.SubContent
The content container for submenu items. Appears in a portal with scrolling and animations.
DropdownMenu.Content and DropdownMenu.SubContent render at Tailwind z-50, Mantle's float tier. When composed inside an open Dialog, AlertDialog, or Sheet, they portal into that overlay's positioner and paint above the overlay that owns them. Outside every overlay, they portal to document.body, below the overlay tier (z-60). When sibling floats share a container, the most recently mounted float paints on top.