Input

We'll send a confirmation link.

Attribute Type Documentation Default Value
field %FormField{}

a form field struct

id :any
type :string "text"
name :any
value :any
label :string
description :string
errors :list []
checked :boolean

the checked flag for checkbox inputs

prompt :string

the prompt for select inputs

options :list

the options to pass to Phoenix.HTML.Form.options_for_select/2

multiple :boolean

the multiple flag for select inputs

false
leading_icon :string

Lucide icon displayed before a text-like input

trailing_icon :string

Lucide icon displayed after a text-like input

class :any
variant :string

Border and focus colour, daisyUI's input-*. Emitted as data-variant.

appearance :string

ghost: no fill, border or shadow until focused (daisyUI's input-ghost).

size :string

Visual density — height and font-size, daisyUI's input-xs … input-xl,

Read more Read less
"md"

same scale as button/1 and badge/1. Emitted as data-size, styled by zero-specificity CSS.

Declaring this attr means size= no longer falls through to @rest, so it shadows the native HTML size= (character width on text and select). That native attribute is a legacy sizing hint the CSS overrides anyway — use class if you genuinely need a character-width input.

rest :global
prefix :slot

content rendered before a text-like input value, inside the same frame

suffix :slot

content rendered after a text-like input value, inside the same frame