Corex forms
No <.form> component — Phoenix to_form/1 + Corex inputs with field={@form[:…]}.
Minimal profile form
<.form for={@form} id="profile-form" phx-change="validate" phx-submit="save">
<.native_input field={@form[:name]} type="text" class="native-input">
<:label>Name</:label>
</.native_input>
<.action type="submit" class="button ui-accent">Save</.action>
</.form>
def handle_event("validate", %{"profile" => params}, socket) do
changeset = %Profile{} |> Profile.changeset(params) |> Map.put(:action, :validate)
{:noreply, assign(socket, :form, to_form(changeset, action: :validate, as: :profile, id: "profile-form"))}
end
Pass auto_invalid on inputs when you want data-invalid borders from visible changeset errors. Form-bound select, combobox, and listbox need controlled with field={@form[:…]}.
Import matching CSS (native-input.css, etc.) and register hooks. MCP get_component for field attr on each input.
For {:array, :string} fields, use field :tags, {:array, :string} and either <.select multiple field={@form[:tags]} items={…}> (fixed options) or <.tags_input field={@form[:tags]}> (free-form). Both submit %{"tags" => ["a", "b"]} via name[]; do not use comma strings on :string fields.
Full checklist: sub-rule corex:forms.