The pieces LineOne's forms are made of: a caption, a help line, an error line and the
field wrapper that puts them around any control.
<.label for="email">Email</.label>
<.help_text>We never share it.</.help_text>
<.error>can't be blank</.error>
<.field label="Country" help="Where you live" errors={@form[:country].errors}>
<select class="form-select ...">…</select>
</.field>input, textarea, range and the groups already render their own field, so field is
for the controls LineaUI does not draw (a native <select>, a third-party widget).
Summary
Functions
A validation message, in LineOne's small red text.
Wraps a control with its caption, help line and errors, laid out the way LineOne's forms
are: the caption on top, the control mt-1.5 under it, then the help and the errors.
The small line under a control that explains it. state="success" paints it green and
state="error" red, as LineOne's validation examples do.
A caption for the control with the id for.
Functions
A validation message, in LineOne's small red text.
<.error>Username is invalid</.error>Attributes
class(:any) - Defaults tonil.- Global attributes are accepted.
Slots
inner_block(required)
Wraps a control with its caption, help line and errors, laid out the way LineOne's forms
are: the caption on top, the control mt-1.5 under it, then the help and the errors.
With as="label" (the default) the whole block is a <label>, so a click on the caption
focuses the control. Groups of checkboxes or radios use as="div", and their own container
then lays the options out.
<.field label="Category" help="Pick one">
<select class="form-select w-full ...">…</select>
</.field>Attributes
field(Phoenix.HTML.FormField) - Takes the errors from a form field. Defaults tonil.id(:string) - The id of the control, for the caption'sfor.label(:string) - The caption. Defaults tonil.label_class(:any) - Classes of the caption text. Defaults tonil.help(:string) - The small line under the control. Defaults tonil.errors(:list) - Messages to show;fieldadds its own once the input was used. Defaults to[].state(:string) - Defaults tonil.Must be one ofnil,"success", or"error".as(:string) - Defaults to"label". Must be one of"label", or"div".class(:any) - Defaults tonil.- Global attributes are accepted.
Slots
inner_block(required)
The small line under a control that explains it. state="success" paints it green and
state="error" red, as LineOne's validation examples do.
<.help_text>This is a help text</.help_text>
<.help_text state="success">Username is valid</.help_text>Attributes
state(:string) - Defaults tonil.Must be one ofnil,"success", or"error".class(:any) - Defaults tonil.- Global attributes are accepted.
Slots
inner_block(required)
A caption for the control with the id for.
<.label for="username">Choose Username:</.label>Attributes
for(:string) - Defaults tonil.class(:any) - Defaults tonil.- Global attributes are accepted.
Slots
inner_block(required)