Skip to content

UIPanelOptions

Defined in: ui/src/types.ts:501

Options for creating a root UIPanel (attached to an entity as a Component).

optional alignItems?: "stretch" | "flex-start" | "center" | "flex-end" | "baseline"

Defined in: ui/src/types.ts:278

PanelProps.alignItems


optional alignSelf?: "stretch" | "auto" | "flex-start" | "center" | "flex-end" | "baseline"

Defined in: ui/src/types.ts:126

PanelProps.alignSelf


optional anchor?: Anchor

Defined in: ui/src/types.ts:502


optional background?: BackgroundOptions

Defined in: ui/src/types.ts:292

PanelProps.background


optional bottom?: PositionValue

Defined in: ui/src/types.ts:152

Offset from the containing block’s bottom edge — px or "<n>%" (only applies to position: "absolute").

PanelProps.bottom


optional consumeInput?: boolean

Defined in: ui/src/types.ts:198

PanelProps.consumeInput


optional direction?: FlexDirection

Defined in: ui/src/types.ts:275

PanelProps.direction


optional flexBasis?: LayoutValue

Defined in: ui/src/types.ts:125

PanelProps.flexBasis


optional flexGrow?: number

Defined in: ui/src/types.ts:123

PanelProps.flexGrow


optional flexShrink?: number

Defined in: ui/src/types.ts:124

PanelProps.flexShrink


optional gap?: number

Defined in: ui/src/types.ts:276

PanelProps.gap


optional height?: LayoutValue

Defined in: ui/src/types.ts:115

PanelProps.height


optional justifyContent?: "flex-start" | "center" | "flex-end" | "space-between" | "space-around" | "space-evenly"

Defined in: ui/src/types.ts:284

PanelProps.justifyContent


optional layer?: string

Defined in: ui/src/types.ts:511

Target UI layer name on the scene’s render tree. Defaults to UI_DEFAULT_LAYER ("ui"), which is auto-provisioned as a screen-space layer via SceneRenderTreeKey.ensureLayer(...) on first use. Any other explicit name must be declared on the scene’s readonly layers or the panel throws on add.


optional left?: PositionValue

Defined in: ui/src/types.ts:146

Offset from the containing block’s left edge — px or "<n>%" (only applies to position: "absolute").

PanelProps.left


optional margin?: number | { bottom?: number; left?: number; right?: number; top?: number; }

Defined in: ui/src/types.ts:120

PanelProps.margin


optional maxHeight?: LayoutValue

Defined in: ui/src/types.ts:119

PanelProps.maxHeight


optional maxWidth?: LayoutValue

Defined in: ui/src/types.ts:117

PanelProps.maxWidth


optional minHeight?: LayoutValue

Defined in: ui/src/types.ts:118

PanelProps.minHeight


optional minWidth?: LayoutValue

Defined in: ui/src/types.ts:116

PanelProps.minWidth


optional offset?: object

Defined in: ui/src/types.ts:503

x: number

y: number


optional onHover?: (hovering) => void

Defined in: ui/src/types.ts:220

boolean

void

PanelProps.onHover


optional onPointerOut?: () => void

Defined in: ui/src/types.ts:219

void

PanelProps.onPointerOut


optional onPointerOver?: () => void

Defined in: ui/src/types.ts:218

void

PanelProps.onPointerOver


optional overflow?: "visible" | "hidden"

Defined in: ui/src/types.ts:291

PanelProps.overflow


optional padding?: Padding

Defined in: ui/src/types.ts:277

PanelProps.padding


optional position?: "relative" | "absolute"

Defined in: ui/src/types.ts:144

Positioning mode for this element relative to its parent. Defaults to "relative" — the element flows in the parent’s flex layout. Set to "absolute" to lift the element out of the flow and pin it via left / top / right / bottom against the parent’s content box.

A position: "relative" ancestor acts as the containing block for any absolute-positioned descendants — useful for HUD overlays, modal backdrops, and badge markers. See <ZStack> in @yagejs/ui-react for an opinionated overlay primitive.

PanelProps.position


optional positioning?: UIPositioning

Defined in: ui/src/types.ts:527

How the panel’s root container is positioned each frame.

  • "anchor" (default) — resolve anchor against the viewport (virtualSize). Classic HUD/menu behavior.
  • "transform" — read entity.get(Transform).worldPosition and reinterpret anchor as the pivot on the panel itself (e.g. BottomCenter → panel’s bottom-center sits at the Transform). Requires a Transform on the entity. The panel is positioned in the layer’s local coords, so this plays with any layer type: screen-space layers (paired with a ScreenFollow component that writes projected screen coords) for constant-size billboards, or world-space layers for genuinely diegetic UI that scales with the camera.

optional right?: PositionValue

Defined in: ui/src/types.ts:150

Offset from the containing block’s right edge — px or "<n>%" (only applies to position: "absolute").

PanelProps.right


optional top?: PositionValue

Defined in: ui/src/types.ts:148

Offset from the containing block’s top edge — px or "<n>%" (only applies to position: "absolute").

PanelProps.top


optional visible?: boolean

Defined in: ui/src/types.ts:153

PanelProps.visible


optional width?: LayoutValue

Defined in: ui/src/types.ts:114

PanelProps.width