Navigation
Dropdown
A small menu attached to a trigger element. The trigger is the trigger snippet, which receives
the open state and a toggle function, so it can take any shape.
Action menu
Icon trigger
Notes
- The menu closes on outside click and on Esc.
- Disabled items don't fire
onclickand don't close the menu. - The danger variant tints the item on hover: useful for destructive actions.
- A destructive item asks first. Its
onclickawaitsconfirm()and deletes only ontrue, so a slip of the pointer in an open menu deletes nothing.
API
| Prop | Type | Default | Description |
|---|---|---|---|
items required | Array<{ label, icon?, variant?, disabled?, onclick }> | no default | Menu items. icon is any @lucide/svelte component. Variant tints the row. |
align | 'left' | 'right' | 'right' | Which edge the menu aligns to. |
class | string | no default | Extra classes on the trigger wrapper. |
trigger required | Snippet<[{ open, toggle }]> | no default | Renders the trigger element. Receives the current open state and a toggle function. |