Structured representation of a UI node in the Dala framework.
This is a public API wrapper around Dala.Ui.Node. The struct definition
mirrors Dala.Ui.Node so that %Dala.Node{} and %Dala.Ui.Node{}
are compatible.
Fields
:id— Stable identity for diffing (required for proper reconciliation):type— Atom indicating the component type (:text,:button,:column, etc.):props— Map of component-specific properties:children— List of childDala.Nodestructs
Example
%Dala.Node{
id: "root",
type: :column,
props: %{padding: :md},
children: [
%Dala.Node{id: "t1", type: :text, props: %{text: "Hello"}},
%Dala.Node{id: "b1", type: :button, props: %{title: "Click"}}
]
}
Summary
Types
Functions
Creates a node struct from a map representation.
The map should have :type and :props keys. Optionally :id and :children.
If :id is not provided, it will be generated from the parent id and child index.
Converts a node to a map.