# `PhiaUiDesign.Codegen.HeexEmitter`
[🔗](https://github.com/charlenopires/PhiaUI/blob/v0.1.17/lib/phiaui_design/codegen/heex_emitter.ex#L1)

Converts a scene graph into a valid HEEx template string.

Walks the tree returned by `Scene.to_tree/1` and emits properly indented
HEEx markup. Each node type maps to a different output form:

- `:phia_component` - `<.button variant={:primary}>Label</.button>`
- `:html_element`   - `<div class="flex gap-4">...</div>`
- `:text`           - plain text content
- `:frame`          - rendered as a `<div>` wrapper

Named slots are emitted as `<:slot_name>content</:slot_name>` inside the
component tag. The special `:inner_block` / `"inner_block"` slot is
rendered as direct text content (not wrapped in a slot tag).

# `emit`

```elixir
@spec emit(
  reference(),
  keyword()
) :: String.t()
```

Emit a complete HEEx string from an entire scene.

## Options

- `:indent` - initial indentation level (default: `0`)
- `:indent_size` - number of spaces per indent level (default: `2`)

## Examples

    scene = Scene.new()
    {:ok, _} = Scene.insert_component(scene, :button, attrs: %{variant: :primary})
    HeexEmitter.emit(scene)
    #=> ~s(<.button variant={:primary} />)

# `emit_node`

```elixir
@spec emit_node(reference(), String.t(), keyword()) :: String.t()
```

Emit HEEx for a single node (looked up by ID) and all its descendants.

Returns an empty string if the node is not found.

## Options

Same as `emit/2`.

---

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