Menu
A menu that gathers a set of controls, that we display conditionally. Menu
manages the opened state automatically.
The user toggles the menu by clicking the control that lives in Menu.Target
.
We add a set of Menu.Item
which are <button>
under the hood.
We may separate two different sections with Menu.Divider
. We may give a section a label with Menu.Label
.
overall structure
<Menu shadow="md">
<Menu.Target>
<Button>Toggle menu</Button>
</Menu.Target>
<Menu.Dropdown>/* */</Menu.Dropdown>
</Menu>
menu proper
<Menu.Dropdown>
<Menu.Label>Application</Menu.Label>
<Menu.Item leftSection={<IconSettings size={14} />}>Settings</Menu.Item>
<Menu.Item leftSection={<IconMessageCircle size={14} />}>Messages</Menu.Item>
<Menu.Divider />
<Menu.Label>Danger zone</Menu.Label>
<Menu.Item leftSection={<IconArrowsLeftRight size={14} />}>Transfer</Menu.Item>
<Menu.Item leftSection={<IconTrash size={14} />}>Delete</Menu.Item>
</Menu.Dropdown>