Customization
Icons
DHTMLX Ribbon uses the default icons of the DHTMLX library. However, you can use another icon font pack. To do this, include the icon font on the page and assign its icons to Ribbon controls.
For example, to use the Material Design icon pack, include a link to its CDN after the source files of DHTMLX Ribbon:
<script type="text/javascript" src="../../codebase/ribbon.js"></script>
<link rel="stylesheet" href="../../codebase/ribbon.css">
<link href="https://cdn.materialdesignicons.com/3.6.95/css/materialdesignicons.min.css?v=6.4.4"
media="all" rel="stylesheet" type="text/css">
Then set an icon name as the value of the icon property in the object with the control parameters:
const data = [
{
type: "block",
"items": [
{
type: "block",
"items": [
{
value: "New",
icon: "mdi mdi-file-outline",
size: "auto",
}
]
},
{
type: "block",
direction: "col",
"items": [
{
value: "Add",
icon: "mdi mdi-plus",
size: "small",
},
{
value: "Remove",
icon: "mdi mdi-minus",
size: "small",
}
]
}
]
}
];
Related sample: Ribbon. Custom icons
note
To use the Font Awesome icon pack, include a link to its CDN in the same way.
Use custom CSS classes
You can change the look and feel of a ribbon.

Related sample: Ribbon. Styling (custom CSS)
Follow these steps:
- Add one or more CSS classes with the settings you need. Place them in the
<style>section of your HTML page or in a separate stylesheet. If you use a stylesheet, include it on the page:
<style>
.my-first-class {
/*some styles*/
}
.my-second-class {
/*some styles*/
}
</style>
- Specify the name of the class you created (or several class names separated by spaces) as the value of the
cssproperty in the Ribbon configuration:
const ribbon = new dhx.Ribbon("ribbon_container", {
css:"my_first_class my_second_class"
});
For example:
<style>
.custom {
--dhx-background-secondary: var(--dhx-color-white);
--dhx-color-primary-light-hover: #aefafa;
--dhx-color-primary-light-active: #118d8d;
}
</style>
<script>
const ribbon = new dhx.Ribbon("ribbon_container", {
css: "custom dhx_widget--bordered"
});
ribbon.data.parse(data);
</script>