Skip to content

UIButton

Defined in: ui/src/UIButton.ts:60

Interactive button for UI panels. Acts as a Yoga flex container — any UIElement (UIText, UIImage, nested panels) can be added as a child via addElement. When constructed with a string children, an internal UIText is auto-added so the builder API (panel.button("Label", ...)) and React JSX strings (<Button>Label</Button>) keep working with no extra setup. Pass width / height explicitly to fix the size, or omit them to let Yoga shrink-to-fit the content.

new UIButton(p): UIButton

Defined in: ui/src/UIButton.ts:88

UIButtonProps

UIButton

readonly container: Container

Defined in: ui/src/UIButton.ts:61


readonly yogaNode: Node

Defined in: ui/src/UIButton.ts:62

UIContainerElement.yogaNode

get children(): readonly UIElement[]

Defined in: ui/src/UIButton.ts:154

readonly UIElement[]

UIContainerElement.children


get disabled(): boolean

Defined in: ui/src/UIButton.ts:280

boolean


get displayObject(): Container

Defined in: ui/src/UIButton.ts:64

Container

UIContainerElement.displayObject


get visible(): boolean

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

boolean

set visible(v): void

Defined in: ui/src/UIButton.ts:288

boolean

void

UIContainerElement.visible

addElement(child): void

Defined in: ui/src/UIButton.ts:158

UIElement

void

UIContainerElement.addElement


applyLayout(): void

Defined in: ui/src/UIButton.ts:200

Apply Yoga-computed positions to children and resize background.

void

UIContainerElement.applyLayout


destroy(): void

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

void

UIContainerElement.destroy


insertElementBefore(child, before): void

Defined in: ui/src/UIButton.ts:173

UIElement

UIElement

void

UIContainerElement.insertElementBefore


removeElement(child): void

Defined in: ui/src/UIButton.ts:164

UIElement

void

UIContainerElement.removeElement


setDisabled(v): void

Defined in: ui/src/UIButton.ts:268

boolean

void


setText(s): void

Defined in: ui/src/UIButton.ts:257

string

void


update(p): void

Defined in: ui/src/UIButton.ts:293

Partial<UIButtonProps>

void

UIContainerElement.update