Skip to content

UIPanelOptions

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

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:172

PanelProps.alignItems


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

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

PanelProps.alignSelf


optional anchor?: Anchor

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


optional background?: BackgroundOptions

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

PanelProps.background


optional direction?: FlexDirection

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

PanelProps.direction


optional flexBasis?: LayoutValue

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

PanelProps.flexBasis


optional flexGrow?: number

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

PanelProps.flexGrow


optional flexShrink?: number

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

PanelProps.flexShrink


optional gap?: number

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

PanelProps.gap


optional height?: LayoutValue

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

PanelProps.height


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

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

PanelProps.justifyContent


optional layer?: string

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

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 margin?: number | { bottom?: number; left?: number; right?: number; top?: number; }

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

PanelProps.margin


optional maxHeight?: LayoutValue

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

PanelProps.maxHeight


optional maxWidth?: LayoutValue

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

PanelProps.maxWidth


optional minHeight?: LayoutValue

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

PanelProps.minHeight


optional minWidth?: LayoutValue

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

PanelProps.minWidth


optional offset?: object

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

x: number

y: number


optional overflow?: "visible" | "hidden"

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

PanelProps.overflow


optional padding?: Padding

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

PanelProps.padding


optional positioning?: UIPositioning

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

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 visible?: boolean

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

PanelProps.visible


optional width?: LayoutValue

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

PanelProps.width