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

window

Floating window. Root-only — must be the top-level widget of its registered screen. Pass `movable`, `resizable`, `closable`, `pos` (default position, only honored on first frame), and `onClose` to wire the close button.

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

window

Floating window. Root-only — must be the top-level widget of its registered screen. Pass movable, resizable, closable, pos (default position, only honored on first frame), and onClose to wire the close button.

Exports

  • window(title, children, opts?) -> Node — returns the window widget node. Module returns the builder function directly.

Types:

  • WindowOpts = { id?, movable?, resizable?, closable?, pos?, onClose?, props?, style? }

Usage

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

window("Inspector", { body }, {
    movable  = true,
    closable = true,
    onClose  = "inspector:close",
})

Notes

  • Signature is window(title, children, opts); the older window(children, opts) shape now warns loudly via log.warn instead of falling back silently to the default "Window" header (closes #2342).
  • The decoder also accepts the raw form { type = "window", title = "...", children = {...} }; title is promoted into props.title automatically.
  • pos is only honored on first frame — subsequent renders preserve the user's drag position so callers never fight egui for window placement.

Interface

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

conforms to

zero/source-extract/v2

ZuiWindow Module Floating window. Root-only — must be the top-level widget of its registered screen. Pass `movable`, `resizable`, `closable`, `pos` (default position, only honored on first frame), and `onClose` to wire the close button. Signature: `window(title, children, opts)` — `title` is a string, `children` is an array of child widgets, `opts` carries window-specific options (movable/resizable/closable/pos/onClose) and the usual id/style/classes. The decoder also accepts the raw form `{ type = "window", title = "...", children = {...} }`, where `title` is promoted into `props.title` automatically. `pos` and `movable` are written at the widget root (not inside `props`) because that's the shape `validate_tree` recommends for `WidgetType::Window` (see `top_level_keys` in `crates/zero_ui_protocol/src/widgets.rs`). `title`, `closable`, `resizable`, and `onClose` stay inside `props` — they're not listed as top-level keys for Window. Closes #2342: previously, swapping the args (e.g. `Z.window({...}, opts)` — easy when migrating from the older `Z.window(children, opts)` shape) produced a silent failure: a non-string ended up in `props.title`, the renderer fell back to the default `"Window"` header, and no validation warning ever fired. Now we warn loudly on construction so the typo is caught at the call site instead of in a screenshot. Consumers: local window = require("modules.deprecated.zui.widget.window") window("Inspector", { body }, { movable = true, closable = true })

build(title: any, children: { any }?, opts: WindowOpts?) → Node

Build a floating window widget node. Must be the root widget of its registered screen. Emits `pos` and `movable` at the widget root (not inside `props`) so the validator doesn't flag `prop-shape-misplaced`. Warns loudly when `title` is not a string so the older `window(children, opts)` calling shape is caught at the call site instead of producing a silent default header. non-strings are coerced to `""` and a warning is logged so the older `window(children, opts)` calling shape surfaces as an obviously-empty header instead of a silent default. Declared `any` (rather than `string`) so the runtime typed-arg gate doesn't hard-error before the in-body coercion fires. `pos` (default position, only honored on first frame), `onClose` (callback id for the close button), `props`, `style`.

argtypedescription
titleanyWindow header text. Must be a string in correct usage —
children{ any }?Array of child widget nodes rendered inside the window.
optsWindowOpts?Optional table: `id`, `movable`, `resizable`, `closable`,

examples

window("Inspector", { body }, { movable = true, closable = true })
⌬ Types
Node = { [string]: any }WindowOpts = {

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/window.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.