Node UI concept

Purpose

A node is the smallest renderable unit in the framework. The Go package exposes nodes through shared interfaces so concrete values can normalize to VNode. Text renders literal escaped text. Element is an allowed HTML tag with validated attributes. Fragment groups children without adding a wrapper. VNode is the serialized node form used by the deterministic HTML renderer and tests.

Boundary

Use nodes to keep server-rendered HTML and unit-test inspection aligned. Prefer Text or Element by default.

Go Shape

import "github.com/busdk/bus-gx/pkg/gx"

node := gx.Element("p",
	gx.Props{"class": "message"},
	gx.Text("Hello <Bus>"),
)

The rendered output is equivalent to:

<p class="message">Hello &lt;Bus&gt;</p>

Contract

Nodes must render deterministically: Text is escaped, Props are sorted, unsafe attribute names are rejected, and Fragment does not add wrapper output.