Initialization
info
Download the DHTMLX Ribbon package as part of the DHTMLX Suite library.
Follow these steps to add DHTMLX Ribbon to an application:
- Include source files
- Create a container
- Initialize Ribbon with the object constructor
- Load data into Ribbon
<!DOCTYPE html>
<html>
<head>
<title>How to Start with DHTMLX Ribbon</title>
<script type="text/javascript" src="../../codebase/suite.js"></script>
<link rel="stylesheet" href="../../codebase/suite.css">
</head>
<body>
<div id="ribbon_container"></div>
<script>
// creating DHTMLX Ribbon
const ribbon = new dhx.Ribbon("ribbon_container");
</script>
</body>
</html>
Include source files
Unpack the downloaded package into your project folder.
Create an HTML file and add the full paths to the JS and CSS files of the DHTMLX Suite library in its header. The files are:
suite.jssuite.css
<script type="text/javascript" src="../../codebase/suite.js"></script>
<link rel="stylesheet" href="../../codebase/suite.css">
Create a container
Add a container for Ribbon and give it an id, for example ribbon_container:
<div id="ribbon_container"></div>
Initialize Ribbon
Initialize Ribbon with the dhx.Ribbon object constructor. The constructor takes two parameters:
- The HTML container for Ribbon
- An object with configuration properties
const ribbon = new dhx.Ribbon("ribbon_container", {
// config options
});
Configuration properties
The Ribbon API overview article describes the properties you can specify to adapt Ribbon to your needs.
Load data into Ribbon
The Data loading article explains how to load data into DHTMLX Ribbon.