Use this skill ALWAYS when the user needs to implement, configure, or troubleshoot Syncfusion JavaScript Ribbon control. The Ribbon provides a Microsoft Office-style command interface with tabs, groups, and various item types. Immediately apply this skill for ribbon layouts, built-in items (buttons, dropdowns, galleries), file menus, backstage views, contextual tabs, keytips, tooltips, resizing behavior, and event handling.
The Syncfusion JavaScript Ribbon control is a hierarchical navigation component that organizes commands into:
Key Features:
📄 Read: references/getting-started.md
📄 Read: references/tabs-and-groups.md
📄 Read: references/built-in-items.md
📄 Read: references/gallery-items.md
📄 Read: references/layouts.md
Note: For handling layout changes, see the ribbonLayoutSwitched event in references/events-and-api.md
📄 Read: references/file-menu.md
📄 Read: references/backstage.md
📄 Read: references/contextual-tabs.md
📄 Read: references/keytips.md
📄 Read: references/tooltip-and-help.md
📄 Read: references/resizing.md
📄 Read: references/events-and-api.md
import { Ribbon, RibbonTabModel, RibbonItemType, RibbonFileMenu } from "@syncfusion/ej2-ribbon";
import { MenuItemModel } from "@syncfusion/ej2-navigations";
// Inject required modules
Ribbon.Inject(RibbonFileMenu);
// Define tabs with groups and items
let tabs: RibbonTabModel[] = [{
header: "Home",
groups: [{
header: "Clipboard",
collections: [{
items: [{
type: RibbonItemType.SplitButton,
splitButtonSettings: {
iconCss: "e-icons e-paste",
content: "Paste",
items: [
{ text: "Keep Source Format" },
{ text: "Merge Format" },
{ text: "Keep Text Only" }
]
}
}]
}, {
items: [{
type: RibbonItemType.Button,
buttonSettings: {
content: "Cut",
iconCss: "e-icons e-cut"
}
}, {
type: RibbonItemType.Button,
buttonSettings: {
content: "Copy",
iconCss: "e-icons e-copy"
}
}]
}]
}]
}, {
header: "Insert",
groups: [{
header: "Tables",
collections: [{
items: [{
type: RibbonItemType.DropDown,
dropDownSettings: {
iconCss: "e-icons e-table",
content: "Table",
items: [
{ text: "Insert Table" },
{ text: "Draw Table" }
]
}
}]
}]
}]
}];
// Define file menu items
let fileMenuItems: MenuItemModel[] = [
{ text: "New", iconCss: "e-icons e-file-new", id: "new" },
{ text: "Open", iconCss: "e-icons e-folder-open", id: "open" },
{ text: "Save", iconCss: "e-icons e-save", id: "save" }
];
// Create Ribbon instance
let ribbon: Ribbon = new Ribbon({
tabs: tabs,
fileMenu: {
menuItems: fileMenuItems,
visible: true
}
});
// Render to element
ribbon.appendTo("#ribbon");
// Add a new tab to existing ribbon
ribbon.addTab({
header: "View",
groups: [{
header: "Views",
collections: [{
items: [{
type: RibbonItemType.Button,
buttonSettings: {
content: "Print Layout",
iconCss: "e-icons e-print"
}
}]
}]
}]
});
// Switch to Simplified layout
ribbon.activeLayout = "Simplified";
// Switch to Classic layout
ribbon.activeLayout = "Classic";
let tabs: RibbonTabModel[] = [{
header: "Home",
groups: [{
header: "Actions",
collections: [{
items: [{
type: RibbonItemType.Button,
buttonSettings: {
content: "Save",
iconCss: "e-icons e-save",
clicked: () => {
console.log("Save button clicked");
// Your save logic here
}
}
}]
}]
}]
}];
let ribbon: Ribbon = new Ribbon({
tabs: tabs,
contextualTabs: [{
visible: true,
isSelected: true,
tabs: [{
header: "Table Design",
groups: [{
header: "Styles",
collections: [{
items: [{
type: RibbonItemType.Gallery,
gallerySettings: {
groups: [{
header: "Table Styles",
items: [
{ content: "Light" },
{ content: "Dark" }
]
}]
}
}]
}]
}]
}]
}]
});
tabs: Array of tab configurations (required)activeLayout: "Classic" | "Simplified" (default: "Classic")fileMenu: File menu configuration with menu itemsbackStageMenu: Backstage configuration with items and contentcontextualTabs: Array of contextual tab configurationsenableKeyTips: Enable/disable keytip navigation (default: false)isMinimized: Show only tab headers when true (default: false)hideLayoutSwitcher: Show/hide layout switcher button (default: false)helpPaneTemplate: Custom template for help pane on the rightlauncherIconCss: CSS class for group launcher iconsselectedTab: Index of currently selected tab (default: 0)When user needs a full-featured document editor with text formatting:
When user needs a data-focused ribbon interface:
When user needs object-specific commands:
When user needs ribbon to work on smaller screens:
When user prioritizes keyboard navigation: