Skip to main content

Custom HTML

The Custom HTML control displays custom HTML content, such as an image, an icon, or another element.

Sidebar Custom HTML item showing a user avatar, name and handle in DHTMLX Suite

Related sample: Sidebar. Custom HTML

Add a Custom HTML control​

Use the add() method of TreeCollection to add custom HTML content to a sidebar:

sidebar.data.add({
type: "customHTML",
id: "userInfo",
css: "user-info_item",
html: "<div className='user-info_container'>" +
"<img className='user-info_avatar' src='../common/ava.png'/>" +
"<div className='user-info_title'>" +
"Gloria McKinney"+
"</div>" +
"<div className='user-info_contact'>" +
"@gmckinney" +
"</div>" +
"</div>"
});

Properties​

Check the list of properties that you can set in the configuration object of a Custom HTML control.

Work with a Custom HTML control​

Use the Sidebar API and the TreeCollection API to work with a Custom HTML control.