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.
Types
This function accepts all HTML input types, considering that:
You may also set type="select" to render a <select> tag
For live file uploads, see Phoenix.Component.live_file_input/1
<.inputfield={@form[:email]}type="email"/><.inputname="my-input"errors={["oh no!"]}/>#Passwordinputwithvisibilitytoggle<.inputtype="password"name="password"label="Password"/>#Thelabelcanbealsopassedasacustom_labelslot(forcheckbox,radio,andtoggleonly)<.inputtype="checkbox"name="terms"><:custom_label>Accept <.ahref="#">terms and conditions</.a></:custom_label></.input>
# Password input with help text
<.inputtype="password"name="password"label="Password"><:help>Password must be at least 8 characters long</:help></.input>
Accessibility Features
Password Input
aria-describedby - Links input with toggle button
aria-label - Provides context for the toggle button
aria-pressed - Indicates toggle state
aria-controls - Associates toggle with input field
Security Features
Password Input
Auto-hide password after 5 seconds when revealed
autocomplete="current-password" for secure browser password management