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.
Implements
Section titled “Implements”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new UIButton(
p):UIButton
Defined in: ui/src/UIButton.ts:78
Parameters
Section titled “Parameters”Returns
Section titled “Returns”UIButton
Properties
Section titled “Properties”container
Section titled “container”
readonlycontainer:Container
Defined in: ui/src/UIButton.ts:54
yogaNode
Section titled “yogaNode”
readonlyyogaNode:Node
Defined in: ui/src/UIButton.ts:55
Implementation of
Section titled “Implementation of”Accessors
Section titled “Accessors”children
Section titled “children”Get Signature
Section titled “Get Signature”get children(): readonly
UIElement[]
Defined in: ui/src/UIButton.ts:143
Returns
Section titled “Returns”readonly UIElement[]
Implementation of
Section titled “Implementation of”disabled
Section titled “disabled”Get Signature
Section titled “Get Signature”get disabled():
boolean
Defined in: ui/src/UIButton.ts:255
Returns
Section titled “Returns”boolean
displayObject
Section titled “displayObject”Get Signature
Section titled “Get Signature”get displayObject():
Container
Defined in: ui/src/UIButton.ts:57
Returns
Section titled “Returns”Container
Implementation of
Section titled “Implementation of”UIContainerElement.displayObject
visible
Section titled “visible”Get Signature
Section titled “Get Signature”get visible():
boolean
Defined in: ui/src/UIButton.ts:259
Returns
Section titled “Returns”boolean
Set Signature
Section titled “Set Signature”set visible(
v):void
Defined in: ui/src/UIButton.ts:263
Parameters
Section titled “Parameters”boolean
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”Methods
Section titled “Methods”addElement()
Section titled “addElement()”addElement(
child):void
Defined in: ui/src/UIButton.ts:147
Parameters
Section titled “Parameters”Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”applyLayout()
Section titled “applyLayout()”applyLayout():
void
Defined in: ui/src/UIButton.ts:189
Apply Yoga-computed positions to children and resize background.
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”UIContainerElement.applyLayout
destroy()
Section titled “destroy()”destroy():
void
Defined in: ui/src/UIButton.ts:304
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”insertElementBefore()
Section titled “insertElementBefore()”insertElementBefore(
child,before):void
Defined in: ui/src/UIButton.ts:162
Parameters
Section titled “Parameters”before
Section titled “before”Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”UIContainerElement.insertElementBefore
removeElement()
Section titled “removeElement()”removeElement(
child):void
Defined in: ui/src/UIButton.ts:153
Parameters
Section titled “Parameters”Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”UIContainerElement.removeElement
setDisabled()
Section titled “setDisabled()”setDisabled(
v):void
Defined in: ui/src/UIButton.ts:243
Parameters
Section titled “Parameters”boolean
Returns
Section titled “Returns”void
setText()
Section titled “setText()”setText(
s):void
Defined in: ui/src/UIButton.ts:232
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”void
update()
Section titled “update()”update(
p):void
Defined in: ui/src/UIButton.ts:268
Parameters
Section titled “Parameters”Partial<UIButtonProps>
Returns
Section titled “Returns”void