Skip to content

UIButton

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

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

UIButtonProps

UIButton

readonly container: Container

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


readonly yogaNode: Node

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

UIContainerElement.yogaNode

get children(): readonly UIElement[]

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

readonly UIElement[]

UIContainerElement.children


get disabled(): boolean

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

boolean


get displayObject(): Container

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

Container

UIContainerElement.displayObject


get visible(): boolean

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

boolean

set visible(v): void

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

boolean

void

UIContainerElement.visible

addElement(child): void

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

UIElement

void

UIContainerElement.addElement


applyLayout(): void

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

Apply Yoga-computed positions to children and resize background.

void

UIContainerElement.applyLayout


destroy(): void

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

void

UIContainerElement.destroy


insertElementBefore(child, before): void

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

UIElement

UIElement

void

UIContainerElement.insertElementBefore


removeElement(child): void

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

UIElement

void

UIContainerElement.removeElement


setDisabled(v): void

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

boolean

void


setText(s): void

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

string

void


update(p): void

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

Partial<UIButtonProps>

void

UIContainerElement.update