Flux components
Dropdown
A menu of actions or options, anchored to a trigger.
The previews on this page are live — open them.
<flux:dropdown>
<flux:button icon:trailing="chevron-down">Order actions</flux:button>
<flux:menu>
<flux:menu.item icon="eye">View details</flux:menu.item>
<flux:menu.item icon="printer">Print invoice</flux:menu.item>
<flux:menu.separator />
<flux:menu.item icon="trash" variant="danger">Cancel order</flux:menu.item>
</flux:menu>
</flux:dropdown>
Position and align
align is logical — start and end follow the reading direction. position takes physical sides (top, right, bottom, left).
<flux:dropdown position="top" align="end">
<flux:button icon:trailing="chevron-up">Opens upward</flux:button>
<flux:menu>
<flux:menu.item>Newest</flux:menu.item>
<flux:menu.item>Cheapest</flux:menu.item>
</flux:menu>
</flux:dropdown>
Checkboxes and radios
A menu can hold state instead of only actions.
<flux:dropdown>
<flux:button icon="funnel" icon:trailing="chevron-down">Filters</flux:button>
<flux:menu>
<flux:menu.checkbox checked>In stock</flux:menu.checkbox>
<flux:menu.checkbox>Free shipping</flux:menu.checkbox>
<flux:menu.checkbox>Discounted</flux:menu.checkbox>
</flux:menu>
</flux:dropdown>
Groups and headings
<flux:dropdown>
<flux:button icon:trailing="chevron-down">Account</flux:button>
<flux:menu>
<flux:menu.group heading="Account">
<flux:menu.item icon="user">My profile</flux:menu.item>
<flux:menu.item icon="shopping-bag" kbd="⌘O">My orders</flux:menu.item>
</flux:menu.group>
<flux:menu.separator />
<flux:menu.item icon="arrow-right-start-on-rectangle" variant="danger">Sign out</flux:menu.item>
</flux:menu>
</flux:dropdown>
Reference
flux:dropdown
| Prop | Description |
|---|---|
| position | Options: top, right, bottom, left. Default: bottom. |
| align | Options: start, center, end. Default: start. |
| gap | Pixel gap between trigger and panel. Default: 5. |
| offset | Pixel shift along the aligned edge. Default: 0. |
| hover | Opens on hover instead of click. |