A2UI.Components.RenderContext (A2UI v0.3.0)

Copy Markdown View Source

Threads rendering state through the component tree.

Holds the component map, data model, surface ID, and optional scope path (for template-expanded children with relative bindings).

Summary

Functions

Builds a RenderContext from a Surface struct.

Returns a new context with the given scope path set.

Types

t()

@type t() :: %A2UI.Components.RenderContext{
  components: %{required(String.t()) => A2UI.Component.t()},
  data_model: A2UI.DataModel.t(),
  scope_path: String.t() | nil,
  surface_id: String.t()
}

Functions

from_surface(surface)

@spec from_surface(A2UI.Surface.t()) :: t()

Builds a RenderContext from a Surface struct.

with_scope(ctx, scope_path)

@spec with_scope(t(), String.t() | nil) :: t()

Returns a new context with the given scope path set.