PhiaUiDesign.Canvas.Node (phia_ui v0.1.17)

Copy Markdown View Source

Represents a single node in the design canvas scene graph.

Each node is either a PhiaUI component, a generic HTML element, a text node, or a frame (grouping container).

Summary

Functions

Create a new PhiaUI component node

Create a new HTML element node

Create a frame (grouping container)

Create a new text node

Types

family_role()

@type family_role() :: :root | :child | nil

layout_direction()

@type layout_direction() :: :vertical | :horizontal | nil

node_type()

@type node_type() :: :phia_component | :html_element | :text | :frame

size_value()

@type size_value() :: :fill | :hug | integer() | String.t() | nil

t()

@type t() :: %PhiaUiDesign.Canvas.Node{
  align_items: atom() | nil,
  attrs: map(),
  children: [String.t()],
  classes: String.t() | nil,
  component: atom() | nil,
  gap: integer() | String.t() | nil,
  height: size_value(),
  id: String.t(),
  justify_content: atom() | nil,
  layout: layout_direction(),
  locked: boolean(),
  module: module() | nil,
  name: String.t(),
  padding: integer() | [integer()] | String.t() | nil,
  parent_id: String.t() | nil,
  slots: map(),
  tag: String.t() | nil,
  text_content: String.t() | nil,
  type: node_type(),
  visible: boolean(),
  width: size_value(),
  wrap: boolean()
}

Functions

new_component(component, opts \\ [])

Create a new PhiaUI component node

new_element(tag, opts \\ [])

Create a new HTML element node

new_frame(opts \\ [])

Create a frame (grouping container)

new_text(content, opts \\ [])

Create a new text node