Renders an input with label and error messages.
A Phoenix.HTML.FormField
may be passed as argument,
which is used to retrieve the input name, id, and values.
Otherwise all attributes may be passed explicitly.
This function accepts all HTML input types, considering that:
type="select"
to render a <select>
tag type="checkbox"
is used exclusively to render boolean values Phoenix.Component.live_file_input/1
See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input for more information. Unsupported types, such as hidden and radio, are best written directly in your templates.
<.input field={@form[:email]} type="email" />
<.input name="my-input" errors={["oh no!"]} />
<.input id="input-single-default-input" label="Input label" name="label" value="foo" theme={:default}/>