Dropdown
Disclose a compact menu through native details behavior.
Preview
Actions
Example
<.dropdown label="Actions"><ul class="menu"><li><a href="/edit">Edit</a></li></ul></.dropdown>
API contract
dropdown/1 uses declared Phoenix attributes and slots. This table is generated from the compiled component metadata.
| Attribute | Type | Required | Default | Accepted values |
|---|---|---|---|---|
label |
:string |
Yes | — |
Any value matching the declared type |
placement |
:atom |
No | :end |
[:start, :center, :end, :top, :bottom, :left, :right] |
open |
:boolean |
No | false |
Any value matching the declared type |
class |
:any |
No | nil |
Any value matching the declared type |
content_class |
:any |
No | nil |
Any value matching the declared type |
rest |
:global |
No | — |
Any value matching the declared type |
| Slot | Required | Slot attributes |
|---|---|---|
inner_block |
Yes | No slot attributes |
States and behavior
Closed and open states use native details and summary behavior.
Keyboard and accessibility
The summary is keyboard-focusable and toggles with Enter or Space. Menu content must contain meaningful links or buttons.