Class: CustomButton

UI.Components. CustomButton


new CustomButton(options)

Creates a new instance of CustomButton.
Parameters:
Name Type Argument 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.
properties.style object <optional>
An object defining inline CSS styles for the button, where each key represents a CSS property and its corresponding value.
properties.className string <optional>
String with CSS classes to be applied to the button, allowing additional styling and customization through external stylesheets.
Example
const testButton = new instance.UI.Components.CustomButton({
  label: 'test',
  title: 'this is a test button',
  onClick: () => console.log('button clicked!'),
  img: 'icon-save',
});

Extends

Methods


setStyle(style)

Sets the style of the Item (padding, border, background, etc.)
Parameters:
Name Type Description
style Object An object that can change the CSS style of the Item component.
Inherited From: