Raxol.Core.Renderer.Element (Raxol v0.5.0)

View Source

Defines the core element structure for the rendering system.

Elements are the building blocks of Raxol's UI system. Each element represents a renderable component with:

  • A tag identifying its type
  • Attributes controlling its appearance and behavior
  • Optional children forming a tree structure

Summary

Functions

Adds children to an existing element.

Creates a new element with the given tag and attributes.

Updates an element's attributes while preserving its structure.

Validates that an element tree follows the component rules.

Types

t()

@type t() :: %Raxol.Core.Renderer.Element{
  attributes: [{atom(), term()}],
  children: [t()],
  content: term(),
  ref: reference() | nil,
  style: map(),
  tag: atom()
}

Functions

add_children(element, children)

Adds children to an existing element.

new(tag, attrs, opts \\ [])

Creates a new element with the given tag and attributes.

update_attrs(element, attrs)

Updates an element's attributes while preserving its structure.

validate(element)

Validates that an element tree follows the component rules.