My Projects
💫 Comet
API
Button

Button API

setEnabled()

Set the Enabled state of the toolbar button.

Type
this.setEnabled(state: boolean): void

setPressed()

Set the Active state of the toolbar button. Also toggles the Enabled state as well.

Type
this.setPressed(state: boolean): void

onPress()

Bind a callback that is invoked whenever the button is pressed.

Type
this.onPress(cb: (state: boolean) => void): void

You can also bind a button directly to the visibility of a view.

See the view documentation for more information.