<< All versions

Skill v1.0.1

currentAutomated scan100/100
corex-ui/corex/corex-forms

+3 new

──Details
PublishedAugust 26, 2026 at 07:46 AM
Content Hashsha256:5109209fe59798ec...
Git SHA694796eb5572
Bump Typepatch
Compare with v1.0.0
──Files
Files (1 file, 1.7 KB)
SKILL.md1.7 KBactive
SKILL.md · 41 lines · 1.7 KB

version: "1.0.1" name: corex-forms description: >- Load when building Phoenix forms with to_form, phx-change validate, phx-submit, field={@form[:name]}, auto_invalid, controlled select/combobox/listbox, native_input checkbox select switch radio_group in lib/_web/_form_live.ex or *_form_live.ex, or when asked about Corex form inputs. Corex has no .form component — use Phoenix.Component.to_form/1.


Corex forms

No <.form> component — Phoenix to_form/1 + Corex inputs with field={@form[:…]}.

Minimal profile form

heex
<.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>
elixir
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.

← v1.0.0All versions