A plain data struct representing a form field declaration.
Each field has a name (matching an Ecto schema field), a type that determines which input component renders it, an auto-humanized label, and a keyword list of type-specific options.
Supported Field Types
:text_input— single-line text input:textarea— multi-line text input (opts:rows):number_input— numeric input (opts:min,max,step):select— dropdown select (opts:options):checkbox— boolean checkbox:toggle— boolean toggle switch:date— date picker:datetime— datetime picker:hidden— hidden field
Common Options
required: true— UI hint only (shows asterisk). Real validation is in Ecto changeset.label: "Custom"— overrides auto-humanized labelplaceholder: "..."— placeholder text
Summary
Functions
Creates a :checkbox field.
Creates a :date field.
Creates a :datetime field.
Creates a :hidden field.
Creates a new Field struct. Label is auto-humanized from name unless provided in opts.
Creates a :number_input field.
Creates a :select field.
Creates a :text_input field.
Creates a :textarea field.
Creates a :toggle field.
Types
@type field_type() ::
:text_input
| :textarea
| :number_input
| :select
| :checkbox
| :toggle
| :date
| :datetime
| :hidden
@type t() :: %PhoenixFilament.Field{ label: String.t(), name: atom(), opts: keyword(), type: field_type() }
Functions
Creates a :checkbox field.
Creates a :date field.
Creates a :datetime field.
@spec new(atom(), field_type(), keyword()) :: t()
Creates a new Field struct. Label is auto-humanized from name unless provided in opts.
Creates a :number_input field.
Creates a :select field.
Creates a :text_input field.
Creates a :textarea field.
Creates a :toggle field.