Dropdown
Dropdown opens a floating panel below a trigger element. Pass options for an action menu built from a
List, or content for any other panel. It requires one of the two.When to use
Usage
options renders an exclusive List: one item stays selected, and clicking it again keeps it. When both options and
content are set, options wins.
<Dropdown options={[{ title: 'Item 1', icon: <Icon icon={clock} /> }, { title: 'Item 2' }]}>
<Button text="Actions" />
</Dropdown>Custom content
content takes any node, or a function that receives { close } — for example to close the panel after a form
inside it submits. Build the List yourself here when you need toggle or multiple selection.
<Dropdown full content={<List multiple content={items} />}>
<Button text="Multiple selection" />
</Dropdown>full matches the panel to the trigger's width; width sets a fixed width and wins over full. position aligns
the panel to the trigger's left (default), center or right edge.
Trigger
An element trigger gets an automatic click toggle. With hoverable, a mouse hover also opens it; touch still opens on
tap. For full control, pass a function as children: it receives { isOpen, open, toggle } and must wire the
toggle itself. distance sets the trigger–menu gap in px (default 4); hideArrow is deprecated and has no effect.
<Dropdown options={items}>
{({ isOpen, toggle }) => (
<Button
onClick={toggle}
text="Menu"
iconPosition="right"
icon={<Icon icon={isOpen ? chevronDown : chevronRight} />}
/>
)}
</Dropdown>The panel scales in from the trigger and fades out on close (motion="scale"). Pass another
motion preset, or motion="none" for an instant open and close. Reduced-motion settings
disable the animation.
Accessibility
- The trigger gets
aria-haspopupandaria-expanded. The panel isrole="menu"withoptions,role="dialog"withcontent. - Escape and a click outside close the panel.
- The trigger must be focusable — use a
Button, not a plaindiv.
Properties
children *ReactNodeRenderPropsnonecontentReactNode((args: ContentRenderProps) => ReactNode)nonedistancenumber4fullbooleannonehideArrowbooleannonehoverablebooleanfalsemotion"fade""scale""slide-up""slide-down""slide-left""slide-right""collapse""sheet""sheet-top""drawer-left""drawer-right""push-left""push-right""none"'scale'optionsListContentType[]none