Skip to main content

ImageButton

The ImageButton control displays a button with an image. Unlike a button, it has no text label, but it can also show a badge with a number and switch between two states (twoState).

Ribbon image button showing a round user avatar with a name label in DHTMLX Suite

Add ImageButton​

Use the add() method of the data module to add an ImageButton control to a ribbon:

ribbon.data.add({
type: "imageButton",
count: 10,
src: "../img/avatar.png"
});

Properties​

Check the list of properties that you can set in the configuration object of an ImageButton control.

Work with ImageButton​

Use the Ribbon API and the TreeCollection API to work with an imageButton control.