Buttons: button/1 (filled, outlined, soft, ghost, glass, in every theme colour),
button_group/1 (segmented joins), icon_button/1 (square icon-only buttons, the top bar
buttons and the round "go" button) and insight_button/1 (the top bar AI insights pill).
<.button>Export report</.button>
<.button color="primary" variant="soft" size="sm">Save</.button>
<.button color="error" variant="outline" shape="pill">Delete</.button>
<.button icon color="primary" variant="soft" aria-label="IA"><.icon name="sparkles" /></.button>
<.button navigate={~p"/orders"} variant="ghost">Orders</.button>
<.button color="primary" loading={@saving}>Saving</.button>
<.button icon variant="outline" pip aria-label="Notifications"><.icon name="bell" /></.button>
<.button_group shape="pill">
<.button variant="outline" size="sm">Day</.button>
<.button variant="outline" size="sm">Week</.button>
</.button_group>
<.icon_button icon="plus" label="Adicionar" variant="primary" />
<.icon_button icon="notification-03" label="Notificações" variant="topbar" dot />The default color="neutral" variant="solid" is the black button of the system. The classes
are lu-b c-<color> v-<variant> s-<size> sh-<shape> (color="current" has no colour class: it
takes the parent's text colour). With href, navigate or patch a link is rendered that
looks the same.
canvas draws the compact lu-btn of the canvas toolbars (<.button canvas size="sm">).
loading blocks the button (no double submit) with disabled (links: aria-disabled) plus
aria-busy, hides the label keeping the width and shows a spinner on top. It is not inert, so
the spinner's role="status" is announced. The design's loading button has no disabled
attribute: that is a documented parity exception. pip puts the notification dot on the corner
of the button.
Summary
Functions
Joins buttons side by side into one segmented control.
A button that holds only an icon. Always labelled with aria-label.
The top bar pill with a count badge (New AI insights).
Functions
Attributes
color(:string) - Defaults to"neutral". Must be one of"current","error","info","mono","neutral","primary","secondary","success","warning", or"white".variant(:string) - Defaults to"solid". Must be one of"bordered","dim","flat","ghost","glass","glow","outline","soft", or"solid".size(:string) - Defaults to"md". Must be one of"lg","md","sm","xl", or"xs".shape(:string) - Defaults to"rounded". Must be one of"pill","rounded", or"square".icon(:any) -true: a square button holding only an icon (the slot; passaria-label). An icon name ("plus","huge-plus"): that icon before the label. Defaults tofalse.control(:boolean) - Kept for compatibility; buttons and fields of a size share one height. Defaults tofalse.canvas(:boolean) - The compact canvas toolbar button (lu-btn,sm/lgfromsize):color,variantandshapedo not apply. Defaults tofalse.type(:string) - Defaults to"button".disabled(:boolean) - Defaults tofalse.loading(:boolean) - Disables the button (no clicks), marks itaria-busy, shows a spinner (announced: notinert). Defaults tofalse.pip(:boolean) - The notification dot on the corner. Defaults tofalse.loading_label(:string) - Read by screen readers for the spinner. Defaults to"Loading".class(:any) - Defaults tonil.style(:string) - Defaults tonil.- Global attributes are accepted. Supports all globals plus:
["href", "navigate", "patch", "method", "download", "target", "rel", "replace", "form", "name", "value"].
Slots
inner_block(required)
Joins buttons side by side into one segmented control.
Attributes
shape(:string) - Defaults to"rounded". Must be one of"rounded", or"pill".class(:any) - Defaults tonil.- Global attributes are accepted.
Slots
inner_block(required)
A button that holds only an icon. Always labelled with aria-label.
<.icon_button icon="download" label="Baixar" />
<.icon_button icon="trash" label="Excluir" variant="danger-soft" size="sm" />
<.icon_button icon="bell" label="Notificações" variant="topbar" dot />Attributes
icon(:string) (required) - Icon name.label(:string) (required) - Thearia-label(and the only text of the button).variant(:string) -topbaris the 40x40 top bar button (lu-tbtn),gothe round teal arrow button;solid,glow,outline,bordered,flat,glass,dim(andsoft,ghost) with acolorare the variants ofbutton/1. Defaults to"default". Must be one of"accent","danger-soft","default","ghost","primary","soft","topbar","go","solid","glow","outline","soft","bordered","flat","glass","ghost", or"dim".color(:string) - Given (or withshape, abutton/1variant or sizexs/xl), the button isbutton/1's, icon only. Defaults tonil. Must be one ofnil,"current","error","info","mono","neutral","primary","secondary","success","warning", or"white".shape(:string) -rounded,pillorsquare(the default of thebutton/1form). Defaults tonil. Must be one ofnil,"pill","rounded", or"square".size(:string) - Square buttons only;xsandxlare those ofbutton/1. Defaults to"md". Must be one of"xs","sm","md","lg", or"xl".dot(:boolean) - A red dot for something new (topbaronly). Defaults tofalse.type(:string) - Defaults to"button".class(:any) - Defaults tonil.- Global attributes are accepted.
The top bar pill with a count badge (New AI insights).
Attributes
count(:any) - The number in the square badge. Defaults tonil.type(:string) - Defaults to"button".class(:any) - Defaults tonil.- Global attributes are accepted.
Slots
inner_block(required)