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.
Was this example helpful?
Usage#
import { DropdownMenu } from "@medusajs/ui"
1<DropdownMenu>2 <DropdownMenu.Trigger>Trigger</DropdownMenu.Trigger>3 <DropdownMenu.Content>4 <DropdownMenu.Item>Edit</DropdownMenu.Item>5 <DropdownMenu.Item>Add</DropdownMenu.Item>6 <DropdownMenu.Item>Delete</DropdownMenu.Item>7 </DropdownMenu.Content>8</DropdownMenu>
API Reference#
Examples#
Sorting#
This example shows how to display collection sorting choices using a Dropdown Menu.
Was this example helpful?
Was this example helpful?
Disabled Items and Using Icons#
Was this example helpful?
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.
Was this guide helpful?