Menu
@fabiocv/ui/menuCode
<Menu
aria-label="Projects"
trigger={<Button leadingIcon={<ChevronDown />}></Button>}
options={[
{ label: 'Selected projects' },
{ label: 'Latest' },
{ label: 'I am feeling lucky' },
{ label: 'Archived', disabled: true },
]}
/>Items
Code
<Menu
aria-label="More"
trigger={<Button leadingIcon={<More />}></Button>}
options={[
{ label: 'E-mail', icon: <Copy /> },
{
label: 'LinkedIn',
icon: <LinkedIn />,
href: 'https://www.linkedin.com/',
trailingIconOnHover: true,
},
{
label: 'GitHub',
icon: <GitHub />,
href: 'https://github.com/',
trailingIconOnHover: true,
},
]}
/>Links with icons
Code
<Menu
aria-label="More"
trigger={<Button leadingIcon={<More />}></Button>}
options={[
{
type: 'group',
label: 'Contact',
notch: true,
options: [{ label: 'E-mail' }, { label: 'Résumé' }],
},
{
type: 'group',
label: 'On social',
notch: true,
options: [{ label: 'LinkedIn' }, { label: 'X' }],
},
]}
/>Groups
Code
<Menu
aria-label="Theme"
trigger={<Button leadingIcon={<Theme />}></Button>}
options={[
{
type: 'radio-group',
defaultValue: 'system',
options: [
{ label: 'System', value: 'system', icon: <Display /> },
{ label: 'Light', value: 'light', icon: <Sun /> },
{ label: 'Dark', value: 'dark', icon: <Moon /> },
],
},
]}
/>Radio items
Code
<Menu
aria-label="Show projects"
trigger={<Button leadingIcon={<ChevronDown />}></Button>}
options={[
{ type: 'checkbox', label: 'Client work', defaultChecked: true },
{ type: 'checkbox', label: 'Side projects', defaultChecked: true },
{ type: 'checkbox', label: 'Experiments' },
]}
/>Checkbox items
Code
<Menu
aria-label="Settings"
trigger={<Button leadingIcon={<More />}></Button>}
options={[
{
type: 'toggle-group',
label: 'Theme',
defaultValue: 'system',
options: [
{ label: 'System', value: 'system', icon: <Display /> },
{ label: 'Light', value: 'light', icon: <Sun /> },
{ label: 'Dark', value: 'dark', icon: <Moon /> },
],
},
{ type: 'toggle', label: 'Sound', icon: <Sound /> },
{ type: 'toggle', label: 'Grid', icon: <Grid /> },
]}
/>Toggles
Code
<Menu
aria-label="Project"
trigger={<Button leadingIcon={<More />}></Button>}
options={[
{ label: 'Open case study' },
{ label: 'Live site', href: 'https://example.com/' },
{ type: 'separator', notch: true },
{
label: 'Share',
options: [
{ label: 'Copy link', icon: <Copy /> },
{ label: 'X', icon: <X />, href: 'https://x.com/' },
],
},
{
label: 'Download',
options: [
{ label: 'Case study as PDF' },
{ label: 'Images as ZIP' },
],
},
{ label: 'Credits' },
]}
/>Submenus