Documentation
    Preparing search index...

    Interface LabelOptions

    Construction options for a Label.

    interface LabelOptions {
        accessibility?: WidgetAccessibility;
        anchor?: readonly [number, number];
        atlas?: GlyphAtlas;
        direction?: ShapingDirection;
        disabled?: boolean;
        enabled?: boolean;
        features?: Readonly<Record<string, number>>;
        focusable?: boolean;
        fontId?: string;
        grow?: number;
        height?: number | null;
        id?: string;
        interactive?: boolean;
        label?: string;
        language?: string;
        letterSpacing?: number;
        margin?: InsetsInit;
        maxHeight?: number;
        maxWidth?: number;
        minHeight?: number;
        minWidth?: number;
        name?: string;
        offset?: readonly [number, number];
        padding?: InsetsInit;
        pivot?: readonly [number, number];
        role?: string;
        script?: string;
        shaper?: ShapingEngine;
        size?: number;
        text?: string;
        visible?: boolean;
        width?: number | null;
        wrapWidth?: number;
    }

    Hierarchy (View Summary)

    • UIWidgetOptions
    • Pick<
          TextLayoutOptions,
          | "shaper"
          | "fontId"
          | "script"
          | "language"
          | "direction"
          | "features"
          | "wrapWidth",
      >
      • LabelOptions
    Index
    accessibility?: WidgetAccessibility
    anchor?: readonly [number, number]

    UIWidget.anchor, as [x, y].

    atlas?: GlyphAtlas

    Label.atlas. Default null.

    direction?: ShapingDirection
    disabled?: boolean
    enabled?: boolean

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

    features?: Readonly<Record<string, number>>
    focusable?: boolean
    fontId?: string
    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.

    language?: string
    letterSpacing?: number

    Label.letterSpacing. Default 0.

    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.

    script?: string
    shaper?: ShapingEngine
    size?: number

    Label.size. Default 1.

    text?: string

    Label.text. Default "".

    visible?: boolean
    width?: number | null
    wrapWidth?: number

    Maximum line width in world units. Omitted (or Infinity) leaves line ends at explicit \n only — bit-identical to the pre-wrapping walk. A finite positive measure wraps at UAX #14-lite opportunities (line-break.ts): breaking spaces, hyphen-minus, and CJK; a single unbreakable run wider than the measure overflows rather than being clipped.