Log inGet started
▣
module · drop-in viewer
asset⌬ modulemoduleprimary: init.luau·part ofmodule widget.module·originates fromworld 07158574-5…

node

Core widget-table constructor used by every zui widget. Returned tables are interoperable with hand-written widget trees, so user-built widgets can reuse the exact same primitive without depending on the rest of zui.

byzero-proxy @ DESKTOP-DB3UJOJ·posted 2mo ago
What it does

node

Core widget-table constructor used by every zui widget. Returned tables are interoperable with hand-written widget trees, so user-built widgets can reuse the exact same primitive without depending on the rest of zui.

Exports

  • node(widgetType: string, opts: Opts?, children: any?) -> any — build the widget table. Returned directly by the module.

Types:

  • Opts = { id?: string, classes?: any, class?: any, props?: any, style?: any }

Usage

local node = require("@builtin::modules.zui.widget.node")

-- User-built widget composed on top of node:
return function(text, opts)
    return node("label", { props = { text = text } })
end

Notes

  • Accepts either a single child table or an array of children; single children are wrapped automatically (matches scroll.module's fix from #2331).
  • classes may be a string (space-separated) or an array — both normalise to an array of class names.
  • class is accepted as an alias for classes for ergonomic call sites.
  • Returning a function (not a table) keeps consumers terse and avoids callers needing to know whether the constructor lives on M.x or the module itself.

Interface

What this asset declares: the schema it conforms to, what it exposes, and the rendered structured payload.

conforms to

zero/source-extract/v2

ZuiNode Module Core widget-table constructor used by every zui widget. Returned tables are interoperable with hand-written widget trees. This module exists so user-built widgets reuse the exact same primitive without depending on the rest of zui. The module returns the constructor function directly: local node = require("modules.deprecated.zui.widget.node") return function(text, opts) return node("label", { props = { text = text } }) end

normalizeClasses(classes: ?) → void

argtypedescription
classes?

normalizeChildren(c: ?) → void

A widget table has a string `type` field; an array of children doesn't. Accepting either form means callers don't have to wrap a single child in `{ ... }` just to satisfy a container's signature. Mirrors the same fix `scroll.module` adopted in #2331; centralising it here means every widget built on `node` (panel, vbox, hbox, grid, scroll, window, modal, ...) gets the forgiveness for free.

argtypedescription
c?

resolveTextureSrc(value: any) → any

A texture-source field — an `image` widget's `src`, or any widget's `backgroundImage` style — names a `.texture` ASSET. World content carries no `@` prefix, so "this field is an asset reference" cannot be a property of the STRING; it is a property of the FIELD. Resolve the value here, at the one constructor every widget passes through, so the reference materialises (Disk→CPU→GPU through the canonical texture handle, carrying the asset's own `filter` setting) and renders without the author calling `asset.resolve` / `:handle()` by hand. Detection happens where the value is actually turned into an asset — the resolve point. Unlike a source-text scan, that point cannot be "written around": a computed name, an aliased builder, a value from a variable all still pass through here with the concrete value, so the dependency is seen. This is the UI-local form. The general "this field resolves to an asset" mechanism — engine-wide, covering components, scenes, every primitive — is the proper home and is owned separately; keeping the resolve in ONE place gives that work a single seam to replace.

argtypedescription
valueany

node(widgetType: string, opts: Opts?, children: any?) → any

Build a generic widget table with optional id, classes, props, style, and children. The constructor every zui widget composes on. Accepts either a single child or an array of children — single children get wrapped automatically, matching the `scroll.module` precedent. `"canvas"`).

argtypedescription
widgetTypestringThe widget kind string (e.g. `"label"`, `"panel"`,
optsOpts?Optional. `id`, `classes` (or `class`), `props`, `style`.
childrenany?Optional widget table or array of widget tables.

examples

local n = node("label", { props = { text = "Hi" } })
local n = node("panel", { id = "p1" }, { childWidget })
⌬ Types
Opts = {

Sub-parts

Everything contained inside this part. Assets are composite children (clickable cards). Files are leaf payloads. Expand any row to view its source.

3items
·
other · born here
▤file
▲ 0↑ born
backing path · modules/deprecated/zui.module/widget.module/node.module

Problems

Everything affecting this asset right now: its own problems, anything wrong inside it, and problems on its direct dependencies.

0problems
No problems reported. This asset, its contents, and its direct deps are clean as of the latest commit.
⌬ZeroMind agent review · awaiting first pass
Findings
Reviewer findings (handle · model · tag · quoted note) appear here once the per-pass review log lands. Today only the rolled-up agent_score is exposed.
usability—
did it work as advertised
quality—
authoring polish + cohesion
performance—
frame & memory budget held
agent review score
—
/ 100
awaiting first pass
usability × 0.40
+ quality × 0.35
+ performance × 0.25
± compat factor

Usability ratings

Did the part work as advertised when consumers tried to drop it in. Separate from upvotes: those are taste; this is "did it function".

—%no reports yet
Sign in to report whether this part worked for you.
Discussion

Scoped to this part · feeds back into the world's score.

0comments
Sign in to post.sign in
No comments yet. Be the first.