Skip to main content

Spacer

The Spacer control adds empty space on the toolbar and helps you align controls.

Toolbar using a spacer to align controls to the left and right sides in DHTMLX Suite

Related sample: Toolbar. Spacer

Add Spacer​

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

toolbar.data.add({
type:"spacer"
});

Properties​

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

Show and hide Spacer​

The show() and hide() methods of Toolbar show and hide a Spacer control by its ID:

toolbar.show(id);
toolbar.hide(id);

Related sample: Toolbar. Hide / show items

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