Menu
A dropdown menu
<Menu> <MenuItem label="Track" startIcon={<Route />} /> <MenuGroup label="Initiate" startIcon={<Carrier />}> <MenuItem label="Shipments" /> <MenuItem label="Templates" /> </MenuGroup> </Menu>
Usage
Controlled
A menu group's state can be fully controlled.
function Controlled() { const [isExpanded, setIsExpanded] = React.useState(true); return ( <Menu> <MenuItem label="Track" startIcon={<Route />} /> <MenuGroup isExpanded={isExpanded} label="Initiate" startIcon={<Carrier />} onExpandedChange={setIsExpanded} > <MenuItem label="Shipments" /> <MenuItem label="Templates" /> </MenuGroup> </Menu> ); }
Selected
Display a selected state on a menu item.
<Menu> <MenuItem label="Track" startIcon={<Route />} /> <MenuGroup label="Initiate" startIcon={<Carrier />}> <MenuItem label="Shipments" /> <MenuItem isSelected label="Templates" /> </MenuGroup> </Menu>
Props
Menu Props
as?The root element to be rendered
MenuItem Props
as?The root element to be rendered
MenuGroup Props
as?The root element to be rendered