Button components used throughout EzAuth flows.
submit/1 is the primary call-to-action inside a form. action/1 is
the generic button primitive (icon + optional label, plus
caller-supplied attributes). strategy/1 renders any strategy as a
form-submit action button.
Summary
Functions
Renders a generic button.
Renders a strategy as a form-submit action button.
Renders a form submit button with a trailing forward arrow.
Functions
Renders a generic button.
Always renders a <button>. Both :icon and :label are optional;
callers attach behaviour and Phoenix LiveView attributes (phx-click,
phx-target, etc.) through :rest.
Options
:icon- optional icon atom supported byEzAuth.UI.Core.icon/1. Always rendered to the left of the label at a fixed size.:label- optional text rendered next to the icon.:variant- thedata-partwritten on the rendered<button>. Defaults to"action".submit/1and other wrappers can pass a different value to attach their own CSS hook.:type- button type. One of:button(default) or:submit. The default avoids accidental parent-form submission; pass:submitexplicitly for form CTAs.
Styling
[data-part="{variant}"]- the button container.[data-part="action-label"]- the label span (only when:labelis set).
Examples
<EzAuth.UI.Core.Buttons.action icon={:google} type={:submit} />
<EzAuth.UI.Core.Buttons.action icon={:github} label="Sign in with GitHub" phx-click="oauth_github" />Attributes
icon(:atom) - Defaults tonil.label(:string) - Defaults tonil.variant(:string) - Defaults to"action".type(:atom) - Defaults to:button. Must be one of:button, or:submit.- Global attributes are accepted. Supports all globals plus:
["name", "value", "title", "disabled"].
Renders a strategy as a form-submit action button.
Derives the icon and label from the strategy's callbacks: identity drives
the icon (with :magic_link overriding to :link); name fills the
"Continue with {name}" label. Submits with name="_strategy" and the
strategy id as the value, so the parent form handler can branch on
params["_strategy"].
Options
:strategy- the strategy module (required).
Styling
[data-part="action"]- the button container.[data-strategy={id}]- strategy id on the button.
Examples
<EzAuth.UI.Core.Buttons.strategy strategy={EzAuth.Strategies.Google} />Attributes
strategy(:atom) (required)- Global attributes are accepted.
Renders a form submit button with a trailing forward arrow.
Options
:label- button text. Defaults to translated"Continue".
Styling
[data-part="submit"]- submit button.
Examples
<EzAuth.UI.Core.Buttons.submit />
<EzAuth.UI.Core.Buttons.submit label="Sign in" />Attributes
label(:string) - Defaults tonil.- Global attributes are accepted. Supports all globals plus:
["disabled"].