Documentation
    Preparing search index...

    Interface UIWidgetOptions

    Construction options shared by every widget.

    Extends NodeOptions, so id is available here too — which is what lets a §79 factory rebuild a widget under its saved id (2026-08-06, A-14).

    interface UIWidgetOptions {
        accessibility?: WidgetAccessibility;
        anchor?: readonly [number, number];
        disabled?: boolean;
        enabled?: boolean;
        focusable?: boolean;
        grow?: number;
        height?: number | null;
        id?: string;
        interactive?: boolean;
        label?: string;
        margin?: InsetsInit;
        maxHeight?: number;
        maxWidth?: number;
        minHeight?: number;
        minWidth?: number;
        name?: string;
        offset?: readonly [number, number];
        padding?: InsetsInit;
        pivot?: readonly [number, number];
        role?: string;
        visible?: boolean;
        width?: number | null;
    }

    Hierarchy (View Summary)

    Index
    accessibility?: WidgetAccessibility
    anchor?: readonly [number, number]

    UIWidget.anchor, as [x, y].

    disabled?: boolean
    enabled?: boolean

    Node.enabled; false removes the widget from layout entirely.

    focusable?: boolean
    grow?: number
    height?: number | null
    id?: string

    The node's Node.id, for a node being restored rather than created (§79: "the engine assigns ids only to newly created objects").

    Omit it — which is what every ordinary construction does — and the engine assigns the next counter value. Supply one and it is used verbatim and reserved, so no later node can be given the same id (2026-08-06, A-17). Ids are opaque strings: the format does not require them to look like the engine's own.

    interactive?: boolean
    label?: string

    UIWidget.label — writes accessibility.label. Applied after UIWidgetOptions.accessibility so an explicit record still wins on every other field, and a lone label does not require building one.

    margin?: InsetsInit
    maxHeight?: number
    maxWidth?: number
    minHeight?: number
    minWidth?: number
    name?: string
    offset?: readonly [number, number]

    UIWidget.offset, as [x, y].

    padding?: InsetsInit
    pivot?: readonly [number, number]

    UIWidget.pivot, as [x, y].

    role?: string

    UIWidget.role — writes accessibility.role. Same merge rule as UIWidgetOptions.label.

    visible?: boolean
    width?: number | null