Dropdown Menu
A dropdown menu component for displaying a list of actions or options.
Actions
A row or card menu behind an icon button. Give an icon-only trigger an
aria-label, and use start for item icons.
Groups, options, and submenus
Label titles a group. RadioGroup picks one value; CheckboxItem toggles
several and shows an "only" shortcut on hover. Call event.preventDefault() in
onSelect to keep the menu open while toggling. Sub nests a menu.
Button trigger
buttonWithChevron renders a small button with a chevron that flips while the
menu is open. Pass the label as children and iconStart for an icon.
Usage
Dropdown.Root is non-modal by default. Inside a drawer or a modal dialog it is always modal, so a long menu can still scroll.
Use Dropdown.RadioGroup and Dropdown.RadioItem when the rows are alternatives and exactly one is chosen. The chosen row shows a check.
Nest a submenu with Dropdown.Sub, Dropdown.SubTrigger and Dropdown.SubContent.
Dropdown.Root Properties
Controlled open state of the dropdown
Initial open state when uncontrolled
Default: false
Called when the open state changes
Traps focus and blocks the page behind the menu. Always true inside a drawer or a modal dialog
Default: false
Dropdown.Trigger Properties
Merges the trigger behavior into its child element
Default: false
Renders the trigger as a Button with a chevron that flips while the menu is open
Default: false
Renders a Button with a truncated label on the left and the chevron on the right
Default: false
Icon before the label in the two Button variants
Button size in the two Button variants. buttonWithChevron defaults to small
Dropdown.Content Properties
Preferred side of the trigger to render against
Default: bottom
Alignment of the content relative to the trigger
Default: center
Distance in pixels from the trigger
Default: 10
Offset in pixels along the alignment axis
Default: 0
Minimum width of the menu in pixels
Default: 249
Uses the trigger's width as the minimum width instead of size
Default: false
Whether to render content in a portal
Default: true
Container element for the portal
Content pinned to the bottom of the menu, with the rows above it scrolling
Return focus to the trigger when the menu closes, except after an outside click
Default: false
Opens every nested submenu upward, so its last row lines up with the row that opened it
Default: false
Dropdown.Item Properties
Icon name, descriptor, or node shown before the label
Icon name, descriptor, or node shown at the end of the row
Called when the item is chosen. Call event.preventDefault() to keep the menu open
Renders the item as a link
Target attribute for link items
Rel attribute for link items
Whether the item is disabled
Default: false
Tooltip on a disabled item that explains why it is disabled
Turns off the tooltip that shows a truncated label in full
Default: false
Side of the truncated-label tooltip
Dropdown.CheckboxItem Properties
Whether the row is checked
Called when the row is toggled
Shows an 'only' button on hover
Default: true
Called when the 'only' button is clicked
Classes for the label wrapper. Replaces the default truncate
Dropdown.RadioGroup and Dropdown.RadioItem Properties
On RadioGroup, the chosen value. On RadioItem, the value this row stands for (required)
RadioGroup only. Called with the value of the chosen row
RadioItem only. Icon name, descriptor, or node shown before the label
RadioItem only. Turns off the tooltip that shows a truncated label in full
Default: false
RadioItem only. Side of the truncated-label tooltip
RadioItem only. Classes for the label
Submenu Properties
Container for a nested submenu
SubTrigger only. Icon shown before the label
SubTrigger only. Hides the trailing chevron
Default: false
SubContent only. Content pinned to the bottom of the submenu, with the rows above it scrolling
SubContent only. Distance in pixels from the sub-trigger
Default: 0
SubContent only. Offset in pixels along the alignment axis
Default: -4
Other Parts
Heading for a group of rows. Takes size: 'small' or 'medium' (default)
Groups related rows
Line between rows
Keyboard shortcut badge pinned to the end of a row
The portal Content renders into unless withPortal is false