Dropdown Menu
A component for rendering dropdown menus that display a set of actions or options to users.
In this guide, you'll learn how to use the Dropdown Menu component.
Usage#
API Reference#
DropdownMenu#
This component is based on the Radix UI Dropdown Menu primitive.
DropdownMenu.Trigger#
This component is based on the Radix UI Dropdown Menu Trigger primitive.
DropdownMenu.Content#
This component is based on the Radix UI Dropdown Menu Content primitive.
Prop | Type | Default |
---|---|---|
sideOffset | 8 | |
collisionPadding | 8 | |
align | "center" |
DropdownMenu.Item#
This component is based on the Radix UI Dropdown Menu Item primitive.
DropdownMenu.Shortcut#
This component is based on the span
element and supports all of its props
DropdownMenu.Hint#
This component is based on the span
element and supports all of its props
DropdownMenu.RadioGroup#
This component is based on the Radix UI Dropdown Menu RadioGroup primitive.
DropdownMenu.RadioItem#
This component is based on the Radix UI Dropdown Menu RadioItem primitive.
Examples#
Sorting#
This example shows how to display collection sorting choices using a Dropdown Menu.
Dropdown with Submenu#
Disabled Items and Using Icons#
Keyboard Shortcuts (with handling)#
This example shows how to visually display keyboard shortcuts in the menu and handle them in your application logic.
You can use the ⌘E and ⌘D shortcuts to trigger the actions of the dropdown items.