A password field with the eye button that shows what was typed.
<.password_input name="password" placeholder="Enter password" />
<.password_input field={@form[:password]} label="Senha" autocomplete="new-password" />It is an input/1 of type="password" (it takes every attr of input/1) with a lock at the
start and an eye at the end. The button flips the type between password and text, swaps
the icon and the accessible name with Phoenix.LiveView.JS, so it needs no hook.
Summary
Functions
Renders the field and the eye.
Functions
Renders the field and the eye.
Attributes
id(:string) - Defaults to the field id, thenname. Defaults tonil.show_label(:string) - Defaults to"Show the password".hide_label(:string) - Defaults to"Hide the password".class(:any) - Defaults tonil.field(Phoenix.HTML.FormField) - Defaults tonil.name(:string) - Defaults tonil.value(:any) - Defaults tonil.label(:string) - Defaults tonil.help(:string) - Defaults tonil.errors(:list) - Defaults to[].placeholder(:string) - Defaults tonil.disabled(:boolean) - Defaults tofalse.size(:string) - Defaults to"md". Must be one of"sm","md", or"lg".variant(:string) - Defaults to"outlined". Must be one of"outlined","filled", or"plain".state(:string) - Defaults tonil.Must be one ofnil,"","success", or"error".strength(:string) - Draws the strength meter (1 to 4 bars) under the field; scoring the password is yours. Defaults tonil. Must be one ofnil,"weak","fair","good", or"strong".autocomplete(:string) - Defaults tonil.required(:boolean) - Defaults tonil.minlength(:integer) - Defaults tonil.maxlength(:integer) - Defaults tonil.form(:string) - Defaults tonil.- Global attributes are accepted. Supports all globals plus:
["label_hint", "layout", "wrapper_class", "shape", "align", "readonly"].
Slots
belowlabel_aside