The actions of one item (a table row, a card), opened by a "⋯" button, and action_button/1,
the direct button for an item with a single action.
<.action_menu id={"actions-" <> c.id} label={"Actions of " <> c.name}>
<:title>{c.name}</:title>
<.action_menu_item navigate={~p"/companies/#{c.id}"} icon="huge-view" kbd="↵">Open</.action_menu_item>
<.action_menu_separator />
<.action_menu_item phx-click="delete" phx-value-id={c.id} icon="huge-delete-02" danger>
Delete
</.action_menu_item>
</.action_menu>
<.action_button label="Delete" icon="huge-delete-02" danger phx-click="delete" />The server renders the ARIA (aria-haspopup/aria-expanded/aria-controls on the button,
popover="manual", role="menu"/menuitem/separator); the hook only flips aria-expanded.
The menu uses the Dropdown machinery through the hook LedgerUI.ActionMenu
(priv/static/ledger_ui/hooks/action_menu.js, the Dropdown hook plus the row marking): top
layer, flips, follows scrolling, Esc/Tab/click outside, arrows, Home/End and letters.
While it is open the hook sets data-am-open on the nearest [data-am-row], tr or
.ledger-ctable-row and tints it.
action_button/1 emits the lu-b button markup directly.
Summary
Functions
Attributes
label(:string) (required) - Accessible name (aria-label).icon(:string) - Defaults tonil.danger(:boolean) - Defaults tofalse.variant(:string) - Defaults to"outline". Must be one of"solid","glow","outline","soft","bordered","flat","glass","ghost", or"dim".size(:string) - Defaults to"sm". Must be one of"xs","sm","md","lg", or"xl".class(:any) - Defaults tonil.- Global attributes are accepted. Supports all globals plus:
["href", "navigate", "patch", "method", "download", "target", "rel", "form", "name", "value", "disabled", "type"].
Slots
inner_block