Icon-only button with a required accessible label, a tooltip (lantern's
tooltip/1), and an optional kbd hint.
<.icon_button label="Toggle panel" kbd="]">
<.icon name="view-columns" />
</.icon_button>
<.icon_button label="New ticket" variant="outline" navigate="/tickets/new">
<.icon name="plus" />
</.icon_button>
Summary
Functions
Attributes
label(:string) (required) - Accessible name and tooltip copy. Required.kbd(:string) - Optional keyboard hint shown in the tooltip after the label. Defaults tonil.variant(:string) - ghost is transparent; outline has a hairline; primary is solid. Defaults to"ghost". Must be one of"ghost","outline", or"primary".size(:string) - Maps onto button icon sizes (sm/md/lg). Defaults to"md". Must be one of"sm","md", or"lg".disabled(:boolean) - Render disabled and non-interactive. Defaults tofalse.tooltip(:boolean) - Wrap withtooltip/1. Turn off when the parent already tips. Defaults totrue.navigate(:string) - LiveView navigate target; renders as a link. Defaults tonil.patch(:string) - LiveView patch target; renders as a link. Defaults tonil.href(:any) - External/full-page href; renders as a link. Defaults tonil.class(:any) - Extra classes merged onto the button. Defaults tonil.- Global attributes are accepted. HTML/
phx-*attrs on the button. Supports all globals plus:["id", "type", "form", "name", "value"].
Slots
inner_block(required) - The icon.