AshSDUI.Renderer (ash_sdui v0.2.0)

Copy Markdown View Source

Converts a UI graph (from DB records or code-based layouts) into a nested tree of %AshSDUI.Renderer.TreeNode{} structs ready for rendering.

The renderer is the boundary between authored layout definitions and rendered SDUI trees:

LiveViews and AshSDUI.Components.SDUIRoot should work with TreeNode values, while builders, registries, and persistence APIs should work with Layout.Node.

Summary

Functions

Converts either a list of UINode records or a layout name string into a nested TreeNode struct suitable for rendering.

Functions

to_tree(layout_name, opts \\ [])

Converts either a list of UINode records or a layout name string into a nested TreeNode struct suitable for rendering.

Use this when you need a renderable tree. If you need the definition tree for registration or persistence work, use AshSDUI.Layout.fetch/2 instead.