Corex API
Imperative push API — not event subscriptions (on_*_change → corex-events).
Client — `<.action>`
<.action class="button" phx-click={Corex.Accordion.set_value("faq", ["first"])}>
Open first
</.action>
Server — socket helper
def handle_event("open_first", _params, socket) do
{:noreply, Corex.Accordion.set_value(socket, "faq", ["first"])}
end
Controlled mode
Pair controlled, value, and on_value_change:
<.accordion id="faq" controlled value={@open} on_value_change="faq_value_change" class="accordion" items={…} />
Discovery
MCP get_component { id: "<name>" } → structured api, or search_docs / mix usage_rules.search_docs "set_value" -p corex.
Full checklist: sub-rule corex:api.