Skip to main content

Custom HTML

This is an item that contains any custom HTML content (for example, an image, icon or other element).

Related sample: Sidebar. Custom HTML

Adding Custom HTML

Any custom HTML content can be easily added to a sidebar with the help of the add() method of Tree Collection:

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

You can provide the following properties in the configuration object of a Custom HTML control.

Working with Custom HTML

You can perform operations over the Custom HTML item with the help of the available Sidebar API and Tree Collection API.