Form chrome — label, error, and a Fluxon-compatible input.
<.input name="email" value="" label="Email" help_text="Used for billing." errors={["is required"]} />
<.input name="q" value="" placeholder="Search…">
<:inner_prefix><.icon name="magnifying-glass" /></:inner_prefix>
</.input>input/1 mirrors Fluxon's surface: field (a Phoenix.HTML.FormField) or
explicit name/value, plus label, sublabel, description, help_text,
errors, size, and the four inner/outer_prefix/suffix slots. Styling is
LanternUI's shadcn-density look; errors flip the border to danger and get
announced via aria-describedby/aria-invalid.
Summary
Functions
Interpolate a changeset error tuple into a message string for host-owned forms.
Functions
Attributes
class(:any) - Extra classes merged onto the root element. Defaults tonil.- Global attributes are accepted. Arbitrary HTML/
phx-*attributes passed through.
Slots
inner_block(required) - Error message text.
Attributes
id(:any) - Element id; derived from field when omitted. Defaults tonil.label(:string) - Primary label above the control. Defaults tonil.sublabel(:string) - Secondary label line under the primary label. Defaults tonil.help_text(:string) - Trailing help line under the field when no errors. Defaults tonil.description(:string) - Helper text under the label stack. Defaults tonil.class(:any) - Extra classes merged onto the root element. Defaults tonil.size(:string) - Control density / type scale. Defaults to"md". Must be one of"xs","sm","md","lg", or"xl".disabled(:boolean) - Render disabled and non-interactive. Defaults tofalse.field(Phoenix.HTML.FormField) - Form field; derives id, name, value, and errors. Defaults tonil.value(:any) - Current input value. Defaults tonil.name(:any) - Form input name; derived from field when omitted. Defaults tonil.errors(:list) - Validation messages; derived from field when used. Defaults to[].type(:string) - HTML input type (text, email, hidden, …). Defaults to"text".- Global attributes are accepted. Arbitrary HTML/
phx-*attributes passed through. Supports all globals plus:["placeholder", "autocomplete", "autofocus", "readonly", "required", "min", "max", "step", "minlength", "maxlength", "pattern", "inputmode", "list", "form"].
Slots
inner_prefix- Affix inside the control, before the input.outer_prefix- Affix outside the control, before the wrap.inner_suffix- Affix inside the control, after the input.outer_suffix- Affix outside the control, after the wrap.
Attributes
for(:string) - id of the labeled control. Defaults tonil.class(:any) - Extra classes merged onto the root element. Defaults tonil.sublabel(:string) - Secondary line under the primary label text. Defaults tonil.description(:string) - Helper line under the label (Fluxon parity). Defaults tonil.- Global attributes are accepted. Arbitrary HTML/
phx-*attributes passed through.
Slots
inner_block(required) - Primary label text.
Interpolate a changeset error tuple into a message string for host-owned forms.