Corex (Corex v0.2.0)

View Source

Import Corex function components into your Phoenix web layer.

# lib/my_app_web.ex (inside html_helpers)
use Corex

Options:

  • only: list of component atoms (for example [:accordion, :dialog])

  • except: list of component atoms to skip

  • prefix: string prefix for wrappers (for example prefix: "ui"<.ui_accordion>)

    use Corex, only: [:accordion, :select], prefix: "ui"

Guides: Installation, Manual installation, Forms, Design, MCP.

Summary

Functions

Returns sorted ids from the component registry for MCP and tooling.

Maps a string MCP component id to its implementing module when registered.

Resolves a registered component id to module and function-component metadata.

HEEx registry ids with no matching Design CSS id after _/- normalization.

Functions

component_ids()

@spec component_ids() :: [atom()]

Returns sorted ids from the component registry for MCP and tooling.

component_module_for_mcp_id(id)

@spec component_module_for_mcp_id(String.t()) :: {:ok, module()} | :error

Maps a string MCP component id to its implementing module when registered.

component_spec(id)

@spec component_spec(atom()) ::
  {:ok,
   %{
     id: atom(),
     module: String.t(),
     function_components: [%{name: atom(), arity: arity()}]
   }}
  | :error

Resolves a registered component id to module and function-component metadata.

heex_only_ids()

@spec heex_only_ids() :: [atom()]

HEEx registry ids with no matching Design CSS id after _/- normalization.

These are helpers or LiveView-only entry points (action, heroicon, navigate, hidden_input, file_upload_live). Aliased ones still resolve to a CSS host via Corex.Design.Components.fetch_css_id/1 when Design is available.