AuroraUI. Components. Actions
(Aurora UI v0.1.1)
View Source
Actions family — button, icon button, button group, and link treatments.
Actions are the kit's most-used primitive, so they set the conventions the
rest of the library follows: finite variant/size attributes (never a
stringly-typed style prop), explicit loading/disabled/destructive
states, global-attribute passthrough, and a single focus-visible ring.
Semantics
button/1 renders a real <button> (or <a> when navigate/href/patch
is set) so keyboard, form, and assistive-technology behavior come from the
platform. A loading button stays focusable and announces its busy state with
aria-busy; it is not silently swapped for a disabled control.
Summary
Functions
Renders a button. Becomes an <a> when navigate, patch, or href is set,
preserving the same visual treatment and focus behavior.
Groups related buttons into a single segmented cluster. Use for a small set of
peer actions, not for navigation (use tabs or a menu there).
Icon-only button. Requires label for a non-visual accessible name; the icon
itself is marked decorative.
Inline text link with consistent underline, focus, and visited treatment.
External links get rel="noopener noreferrer", target="_blank", and a
visually-hidden "(opens in new tab)" hint.
Functions
Renders a button. Becomes an <a> when navigate, patch, or href is set,
preserving the same visual treatment and focus behavior.
Examples
<.button>Save</.button>
<.button variant="danger" loading={@deleting}>Delete</.button>
<.button variant="link" navigate={~p"/docs"}>Read the docs</.button>Attributes
variant(:string) - Visual priority.primaryfor the main action,dangerfor destructive. Defaults to"primary". Must be one of"primary","secondary","ghost","subtle","danger", or"link".size(:string) - Defaults to"md". Must be one of"sm","md", or"lg".type(:string) - button type when rendered as <button>. Defaults to"button".disabled(:boolean) - Defaults tofalse.loading(:boolean) - shows a spinner and sets aria-busy. Defaults tofalse.full_width(:boolean) - Defaults tofalse.href(:string) - Defaults tonil.navigate(:string) - Defaults tonil.patch(:string) - Defaults tonil.- Global attributes are accepted. Supports all globals plus:
["form", "name", "value", "download", "target", "rel", "phx-click", "phx-value-id"].
Slots
icon_start- leading icon; hidden from AT (decorative).icon_endinner_block(required)
Groups related buttons into a single segmented cluster. Use for a small set of
peer actions, not for navigation (use tabs or a menu there).
Attributes
label(:string) - group accessible name (role=group). Defaults tonil.- Global attributes are accepted.
Slots
inner_block(required)
Icon-only button. Requires label for a non-visual accessible name; the icon
itself is marked decorative.
<.icon_button label="Close"><.x_icon /></.icon_button>Attributes
label(:string) (required) - accessible name; rendered as aria-label + tooltip.variant(:string) - Defaults to"ghost". Must be one of"primary","secondary","ghost","subtle","danger", or"link".size(:string) - Defaults to"md". Must be one of"sm","md", or"lg".disabled(:boolean) - Defaults tofalse.loading(:boolean) - Defaults tofalse.- Global attributes are accepted. Supports all globals plus:
["form", "name", "value", "phx-click", "phx-value-id", "type"].
Slots
inner_block(required) - the icon.
Inline text link with consistent underline, focus, and visited treatment.
External links get rel="noopener noreferrer", target="_blank", and a
visually-hidden "(opens in new tab)" hint.
Attributes
navigate(:string) - Defaults tonil.patch(:string) - Defaults tonil.href(:string) - Defaults tonil.variant(:string) - Defaults to"default". Must be one of"default","subtle", or"quiet".external(:boolean) - adds rel/target and a visual affordance. Defaults tofalse.- Global attributes are accepted.
Slots
inner_block(required)