Button Dashboard Item
The Button Dashboard Item is used to trigger custom actions from Dashboard Scripts.
Settings
| Setting | Description |
|---|---|
| Label | The text to display on the button. |
| Script ID | Identifies how this item is referenced in Dashboard Scripts. |
| Background Color | The background color to display for the button. |
| Hover Color | The background color to display for the button when hovering it with the mouse. |
| Text Color | The text color to display for the button. |
onClick Event
The Button Dashboard Item is usually used within a Dashboard Script by binding to its onClick event, such as
const button = gsApi.dashboard.button('my button');
button.onClick(async () => {
// Change the name of the button
await button.updateProperties({
label: 'You clicked me!'
});
});
