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.

Toolbar image button showing a round avatar photo with a number badge in DHTMLX Suite

Related sample: Toolbar. ImageButton

Add ImageButton​

Use the add() method of TreeCollection to add an ImageButton control to a toolbar:

toolbar.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​

You can hide and disable an ImageButton control and add a tooltip to it, as you can with a button. You can also change the state of a two-state ImageButton.

Check the full list of available operations in the Toolbar API and the TreeCollection API.