Overlays
Dropdown & menus
Action menus, dropdowns and menubars.
Dropdown menu
Fluxon-compatible family with WAI-ARIA menu semantics — ↑↓ move through items, Esc closes, focus returns to the trigger.
Label trigger
Default toggle button from label=; header, buttons, separator, and danger item.
<.dropdown id="dd-demo" label="Actions">
<.dropdown_header>object.png</.dropdown_header>
<.dropdown_button><.icon name="arrow-down-tray" /> Download</.dropdown_button>
<.dropdown_button><.icon name="arrow-path" /> Rename</.dropdown_button>
<.dropdown_separator />
<.dropdown_button data-danger><.icon name="trash" /> Delete</.dropdown_button>
</.dropdown>
Custom toggle & placement
:toggle slot for any trigger; placement anchors the panel.
<.dropdown id="dd-icon" placement="bottom-end">
<:toggle>
<.button size="icon" aria-label="More"><.icon name="ellipsis-horizontal" /></.button>
</:toggle>
<.dropdown_button>Duplicate</.dropdown_button>
<.dropdown_button>Move…</.dropdown_button>
</.dropdown>
Custom content
Use dropdown_custom for non-item content that should stay inside the menu panel.
<.dropdown id="dd-custom" label="Account">
<.dropdown_custom><p>Signed in as ada@example.com</p></.dropdown_custom>
</.dropdown>
API reference
Props and slots, introspected from the component.
dropdown/1| Prop | Type | Default | Description |
|---|---|---|---|
animation |
string |
nil |
accepted for Fluxon compat |
animation_enter |
string |
nil |
accepted for Fluxon compat |
animation_leave |
string |
nil |
accepted for Fluxon compat |
class |
any |
nil |
classes for the menu panel |
container_class |
any |
nil |
Extra classes on the dropdown root wrapper. |
controlled |
boolean |
false |
Server-driven open state: `open` is truth, patches flow into the machine. |
disabled |
boolean |
false |
Render disabled and non-interactive. |
hover_close_delay |
integer |
nil |
accepted for Fluxon compat |
hover_open_delay |
integer |
nil |
accepted for Fluxon compat |
id |
string |
nil |
Stable DOM id for the dropdown hook; auto-generated when omitted, mirroring Fluxon's dropdown (drop-in parity). |
label |
string |
nil |
default toggle button text when no :toggle slot |
on_change |
string |
nil |
Server event pushed on open change (`lantern:menu:set-open` replies). |
on_change_client |
string |
nil |
Bubbling DOM CustomEvent dispatched on open change. |
open |
boolean |
nil |
Open state for `controlled` mode (client mode ignores it). |
open_on_hover |
boolean |
false |
accepted for Fluxon compat; click/keyboard only |
placement |
bottom-start | bottom-end | top-start | top-end |
"bottom-start" |
Where the menu anchors relative to the toggle. |
toggle_class |
any |
nil |
Classes on the default toggle button. |
| Slots | |||
:inner_block* |
Menu items (buttons, links, separators). | ||
:toggle |
Custom trigger; defaults to a button using label. | ||
dropdown_button/1| Prop | Type | Default | Description |
|---|---|---|---|
class |
any |
nil |
Extra classes merged onto the root element. |
disabled |
boolean |
false |
Render disabled and non-interactive. |
| Slots | |||
:inner_block* |
Button menu item label. | ||
dropdown_link/1| Prop | Type | Default | Description |
|---|---|---|---|
class |
any |
nil |
Extra classes merged onto the root element. |
disabled |
boolean |
false |
Render disabled and non-interactive. |
| Slots | |||
:inner_block* |
Link menu item label. | ||
dropdown_header/1| Prop | Type | Default | Description |
|---|---|---|---|
class |
any |
nil |
Extra classes merged onto the root element. |
| Slots | |||
:inner_block* |
Header label content. | ||
dropdown_separator/1| Prop | Type | Default | Description |
|---|---|---|---|
class |
any |
nil |
Extra classes merged onto the root element. |
dropdown_custom/1| Prop | Type | Default | Description |
|---|---|---|---|
class |
any |
nil |
Extra classes merged onto the root element. |
| Slots | |||
:inner_block* |
Custom non-item content inside the menu. | ||