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.
1import { Button } from "@ngrok/mantle/button";2import { DropdownMenu } from "@ngrok/mantle/dropdown-menu";3import { Icon } from "@ngrok/mantle/icon";4 5<DropdownMenu.Root>6 <DropdownMenu.Trigger asChild>7 <Button appearance="filled" type="button">8 Open Menu9 </Button>10 </DropdownMenu.Trigger>11 <DropdownMenu.Content>12 <DropdownMenu.Label>corby.pickles@ngork.com</DropdownMenu.Label>13 <DropdownMenu.Separator />14 <DropdownMenu.RadioItem name="theme" value="system">15 <Icon svg={<DesktopIcon />} />16 System Preference17 </DropdownMenu.RadioItem>18 <DropdownMenu.Separator />19 <DropdownMenu.Item>20 <Icon svg={<GearIcon />} />21 User Settings22 </DropdownMenu.Item>23 <DropdownMenu.Separator />24 <DropdownMenu.Item>25 <Icon svg={<SignOutIcon />} />26 Log out27 </DropdownMenu.Item>28 </DropdownMenu.Content>29</DropdownMenu.Root>;The DropdownMenu components are built on top of Radix Dropdown Menu.
The root, stateful component that manages the open/closed state of the dropdown menu.
The trigger button that opens the dropdown menu.
The container for the dropdown menu content. Appears in a portal with scrolling and animations.
All props from Radix DropdownMenu.Content, plus:
A standard item in the dropdown menu that can be selected or activated.
A menu item with a checkbox that can be controlled or uncontrolled.
All props from Radix DropdownMenu.CheckboxItem, including:
A radio group container for exclusive selection within the dropdown menu.
A radio item where only one item in the group can be selected at a time.
All props from Radix DropdownMenu.RadioItem, including:
A label for grouping and describing sections within the dropdown menu.
A group container for organizing related dropdown menu items. Accepts all props from Radix DropdownMenu.Group.
A visual separator for dividing sections within the dropdown menu. All props from Separator.
A keyboard shortcut indicator for dropdown menu items. All props from span.
A submenu container for creating nested dropdown menus. Accepts all props from Radix DropdownMenu.Sub.
The trigger item that opens a submenu when hovered or focused.
The content container for submenu items. Appears in a portal with scrolling and animations.