Skip to content

ButtonOptions

Defined in: ui/widgets/button.ts:26

optional background?: UIVisualInit

Defined in: ui/widgets/button.ts:33

Background renderer config. Default: solid white quad.


optional disabled?: boolean

Defined in: ui/widgets/button.ts:47

Start in the disabled state (Interactable.enabled = false).


events: EntityEventQueue

Defined in: ui/widgets/button.ts:28


optional fadeDuration?: number

Defined in: ui/widgets/button.ts:45

Tween time for color/scale state changes. Default 0 (snap).


optional focusable?: boolean

Defined in: ui/widgets/button.ts:49

Participate in Tab traversal + Enter/Space activation. Default true.


optional node?: UINodeInit

Defined in: ui/widgets/button.ts:31

CSS-box layout. Default: fill the parent.


optional onClick?: (entity) => void

Defined in: ui/widgets/button.ts:52

number

void


optional parent?: number

Defined in: ui/widgets/button.ts:29


optional states?: Record<string, ButtonStateVisual>

Defined in: ui/widgets/button.ts:43

Map of state name (e.g. “normal”, “hover”, “pressed”, “disabled”) to its visual override. The $interaction driver writes the four canonical state names; callers may add more (e.g. “loading”) and flip them manually via setButtonState. Omit to default to the active theme’s control roles (themeButtonStates).


optional tabIndex?: number

Defined in: ui/widgets/button.ts:51

Tab order within the focus ring. Default 0 (document order).


optional text?: string | TextInit

Defined in: ui/widgets/button.ts:35

Label text. Omit to skip spawning a child label entity.


optional userGesture?: boolean

Defined in: ui/widgets/button.ts:56

Run onClick inside the host’s own release event rather than on the next frame, for a call a host accepts only from a player’s gesture (sharing a recording on WeChat).


world: World

Defined in: ui/widgets/button.ts:27