# `PhiaUiDesign.Web.ComponentRenderer`
[🔗](https://github.com/charlenopires/PhiaUI/blob/v0.1.17/lib/phiaui_design/web/component_renderer.ex#L1)

Renders real PhiaUI components dynamically for the design canvas.

Attempts to call the actual component function with the node's attrs and
slots. Falls back gracefully to `{:error, reason}` on any failure so the
editor can show a placeholder instead.

## Slot construction

`inner_block` text content is wrapped in a proper Phoenix slot struct so
that `render_slot(@inner_block)` works inside the target component. Named
slots are not supported yet (they require compile-time HEEx).

# `render_to_html`

```elixir
@spec render_to_html(module() | nil, atom(), map(), map()) ::
  {:ok, String.t()} | {:error, String.t()}
```

Render a PhiaUI component to an HTML string.

Returns `{:ok, html_string}` on success, `{:error, reason}` on failure.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
