Corex events

From corex-ui/corex · View interactive version

Corex events is an AI agent skill from the GitHub repository corex-ui/corex. Load when adding on_value_change, on_value_change_client, on_focus_change, on_open_change, handle_event for component interaction, controlled mode with value assign, ColocatedHook CustomEvent listeners, phx-update ignore on listener wrapper, or component Events doc pages. For Corex.* imperative help

How to use this skill

Skill file

Corex events

Subscriptions when users interact — not imperative Corex.* pushes (corex-api).

Server event

<.accordion id="faq" class="accordion" items={items} on_value_change="accordion_value_changed" />
def handle_event("accordion_value_changed", %{"id" => id, "value" => value}, socket) do
  {:noreply, assign(socket, :open, value)}
end

Controlled

<.accordion id="faq" controlled value={@open} on_value_change="faq_value_change" class="accordion" items={items} />

Client event

on_value_change_client="accordion-value-changed" → CustomEvent on component root. Listener wrapper needs phx-update="ignore".

Never invent event names — MCP get_component returns structured events plus on_* attrs.

Full checklist: sub-rule corex:events.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.