Button Component Props

Hierarchy

Properties

color?: PBColor4

Color of the label.

Default Value

{ r: 1, g: 1, b: 1, a: 1 }

disabled?: boolean

Enable or disable the pointer events on the button

font?: UiFontType

Label font type.

Default Value

'sans-serif'

fontSize?: ScaleUnit

Label font size.

Default Value

10

key?: Key

Uinique key to identiy elments when iterating arrays

onInputDown?: Partial<Record<InputAction, EventSystemCallback>>

triggered on input down event

onInputDrag?: Partial<Record<InputAction, EventSystemCallback>>

triggered on input drag event

onInputDragEnd?: Partial<Record<InputAction, EventSystemCallback>>

triggered on input drag event

onInputDragLocked?: Partial<Record<InputAction, EventSystemCallback>>

triggered on input drag event

onInputUp?: Partial<Record<InputAction, EventSystemCallback>>

triggered on input up event

onMouseDown?: EventSystemCallback

triggered on mouse down event

onMouseDrag?: EventSystemCallback

triggered on mouse drag event

onMouseDragEnd?: EventSystemCallback

triggered on mouse drag event

onMouseDragLocked?: EventSystemCallback

triggered on mouse drag event

onMouseEnter?: EventSystemCallback

triggered on mouse hover event

onMouseLeave?: EventSystemCallback

triggered on mouse leave event

triggered on mouse up event

outlineColor?: PBColor4

Outline color of the text.

Default Value

{ r: 0, g: 0, b: 0, a: 1 }

outlineWidth?: number

Outline width of the text.

Default Value

0

textAlign?: TextAlignType

Label align position.

Default Value

'middle-center'

textWrap?: UiTextWrapType

Behaviour when text reached.

Default Value

'wrap'

uiBackground?: UiBackgroundProps

To define a background color or image

uiTransform?: UiTransformProps

Layout component, to position things in the canvas

value: string

Primary content.

variant?: "primary" | "secondary"

Use any of the available button style types to create a styled button.