Creates a new instance of CustomButton.
Parameters:
Name |
Type |
Description |
options |
Object
|
An object that contains the properties of the CustomButton.
Properties
Name |
Type |
Argument |
Description |
dataElement |
string
|
<optional>
|
The data element of the button. |
label |
string
|
<optional>
|
The label of the button. |
title |
string
|
<optional>
|
The title of the button. |
img |
string
|
<optional>
|
The icon of the button. |
onClick |
function
|
<optional>
|
The function that is called when the button is clicked. |
|
Example
const testButton = new instance.UI.Components.CustomButton({
label: 'test',
title: 'this is a test button',
onClick: () => console.log('button clicked!'),
img: 'icon-save',
});