Skip to main content

Ribbon

  • The ribbon's UI configuration can be extended using a manifest.
  • You can freely configure the ribbon's tabs and groups, and place buttons to invoke commands and checkboxes to display/change ON/OFF states on the ribbon.
  • The ribbon definition is common regardless of whether it's implemented as a C# script, Python script, or .NET DLL.

Ribbon Elements

The following ribbon elements can be extended with extensions:

  • Tab
  • Group
  • Single Control
  • Button
  • Checkbox
  • Separator
  • Compound Control
  • Button Group
  • Stack Panel
  • Menu
  • Split Button

Element-Specific Details

Tabs (Elements of tabs)

  • Tabs that make up the ribbon

Ribbon Tab

  • Properties
KeyDescriptionRangeRequired
idAn ID that uniquely identifies the tab. A unique string across all components of the ribbon. 1String representing the IDRequired
labelTab labelOptional stringRequired 4
orderBefore/orderAfterThe ID of the ribbon element indicating the relative position where the tab will be added. 2
If not specified, it will be added before the [Help] tab. If a tab with the same ID already exists, the new tab will not be added and will remain in the existing tab's position.
For IDs of system-standard built-in ribbon elements, see Ribbon Element IDs.
String representing the ID-
visibleThe visibility state of the target element. Omitted or specified as true displays it. Specified as false hides it."true", "false"-
groupsArray of groups that make up the tabObject array-
  • Child element type

  • Group

You can specify either before (orderBefore) or after (orderAfter) the specified element.

If not specified for elements other than tabs, it will be added to the end of the sibling elements.

Group (groups element)

  • Groups that divide the ribbon tabs

Group

  • Properties
KeyDescriptionRangeRequired or Not
idAn ID that uniquely identifies the target element. A unique string among all ribbon components. 1String representing the IDRequired
labelGroup labelAny stringRequired 4
orderBefore/orderAfterThe ID of the ribbon element indicating the relative position to which the target element will be added. 2
For IDs of built-in ribbon elements in the system, please refer to Ribbon Element IDs.
String representing the ID-
visibleThe display state of the target element. Omitted or specified as true displays the element. Specified as false hides it."true", "false"-
controlsAn array of controls to be placed within a groupObject array-
  • Types of controls that can be placed as child elements

  • Button

  • CheckBox

  • Separator

  • ButtonGroup

  • StackPanel

  • Menu

  • SplitButton

Button (type: Button)

  • Command execution button on the ribbon

Button

  • You can assign a command to be executed when the button is pressed.

  • The button's enabled/disabled state and toggle state are linked to the assigned command.

  • Property

KeyDescriptionRangeRequired
typeElement type."Button"Required
idID that uniquely identifies the target element. A unique string among all ribbon components. 1String representing the IDRequired
labelButton labelAny stringRequired 5
descriptionDescription displayed in the tooltipAny string-
orderBefore/orderAfterID of the ribbon element indicating the relative position to add the target element. 2String representing the ID-
visibleVisibility of the target element. Displayed if omitted or set to true. Hided if set to false."true", "false"-
isEnabledProperty name that holds the enabled/disabled state of the button. If omitted, it is linked to the state of the assigned command.String representing the property name-
imageSmallPNG file path for the small icon to display on the button (16 x 16 image recommended). 3String representing the relative path-
imageLargePNG file path for the large icon to display on the button (32 x 32 image recommended). 3String representing the relative path-
commandID of the command to assign to the button.String representing the IDRequired

Checkbox (type: CheckBox)

  • Checkbox

CheckBox

  • The display of the checkbox changes depending on the value of the property associated with the isChecked property.

  • Manipulating the checkbox updates the value of the associated property.

  • Property

KeyDescriptionRangeRequired
typeThe type of element."CheckBox"Required
idAn ID that uniquely identifies the target element. A unique string across all components of the ribbon. 1A string representing the IDRequired
labelThe label of the checkboxAny stringRequired
orderBefore/orderAfterThe ID of the ribbon element indicating the relative position to add the target element. 2A string representing the ID-
visibleThe display state of the target element. Omitted or true displays it. false hides it."true", "false"-
isCheckedProperty name that holds the checked stateString representing the property nameRequired

Separator (type: Separator)

  • Separator.

Separator

  • Property
KeyDescriptionRangeRequired or not
typeElement type."Separator"Required
idID that uniquely identifies the tab. A unique string across all components of the ribbon. 1String representing the IDRequired

Button Group (type: ButtonGroup)

  • Container that displays multiple buttons side-by-side like a toolbar

Button Group

  • Property
KeyDescriptionRangeRequired or not
typeElement type."ButtonGroup"Required
idAn ID that uniquely identifies the target element. A unique string among all ribbon components. 1String representing the IDRequired
orderBefore/orderAfterThe ID of the ribbon element indicating the relative position to which the target element will be added. 2String representing the ID-
visibleThe display state of the target element. Displayed if omitted or set to true. Hided if set to false."true", "false"-
controlsAn array of controls to be arranged side-by-sideObject array-
  • Types of controls that can be placed as child elements

  • Button (small)

  • Separator

Stack Panel (type: StackPanel)

  • A container that displays multiple buttons arranged vertically

Stack Panel

  • Used when you want to display small image buttons arranged vertically.

  • Properties

KeyDescriptionRangeRequired
typeThe type of element."StackPanel"Required
idAn ID that uniquely identifies the target element. A unique string among all components of the ribbon. 1A string representing the IDRequired
orderBefore/orderAfterThe ID of the ribbon element indicating the relative position to which the target element will be added. 2A string representing the ID-
visibleThe visibility state of the target element. Omitted or set to true to display. Set to false to hide."true", "false"-
controlsAn array of controls to arrange side by side. Up to 3 controls can be placed.Object Array-
  • Types of controls that can be placed as child elements

  • Button (Small)

  • SplitButton (Small)

  • CheckBox

  • A container that displays multiple buttons in a pull-down menu format

Menu

  • Properties
KeyDescriptionRangeRequired or Not
typeElement type."Menu"Required
idAn ID that uniquely identifies the target element. A unique string among all components of the ribbon. 1String representing the IDRequired
labelMenu labelAny stringRequired
orderBefore/orderAfterID of the ribbon element indicating the relative position to add the target element. 2String representing the ID-
visibleVisibility of the target element. Omitted or set to true to display. Set to false to hide."true", "false"-
imageLargePNG file path of the icon to display on the button.String representing a relative path-
controlsArray of controls to arrange side by sideObject array-
  • Types of controls that can be placed as child elements

  • Button (small)

  • Separator

Split Button (type: SplitButton)

  • A container that has the functionality of a button that can execute a command when pressed, and also displays another button in a pull-down menu format.

Split Button

  • Properties
KeyDescriptionRangeRequired or not
typeType of element."SplitButton"Required
idAn ID that uniquely identifies the target element. A unique string among all components of the ribbon. 1String representing the IDRequired
labelButton labelOptional stringRequired
descriptionDescription displayed in the tooltipOptional string-
orderBefore/orderAfterID of the ribbon element indicating the relative position to which the target element will be added. 2String representing the ID-
visibleVisibility of the target element. Displayed if omitted or set to true. Hided if set to false."true", "false"-
isEnabledProperty name that maintains the button's enabled/disabled state. If omitted, it is linked to the state of the assigned command.String representing the property name-
imageSmallPNG file path of the small icon to display on the button (16 x 16 image recommended). 3String representing the relative path-
imageLargePNG file path of the large icon to display on the button (32 x 32 image recommended). 3String representing relative path-
commandID of the command to assign to the buttonString representing the IDRequired
controlsArray of controls to arrange side by sideObject array-
  • Types of controls that can be placed as child elements

  • Menu

Multilingual Support

  • The values ​​of the label and description properties can also be localized.

  • Instead of specifying the display string as the property value, specifying it as "%resource string name%" will replace it with the resource string in the localized locale file.

note

For details on multilingual support, see Advanced Topics > Multilingual Support.

Example of Ribbon Definition

manifest.json
{
"name": "My Extension",

"main": "main.cs", //For C# scripts. For Python, use "main.py"
"lifecycle": "project",
"baseprofile": "MBD",
"extensionPoints": {
"ribbon": {
"tabs": [
{
"id": "MBD",
"label": "MBD",
"orderAfter": "System.View",
"groups": [
{
"id": "MbdSync",
"label": "Block",
"controls": [
{
"id": "MbdSync.CreateBlock",
"type": "Button",
"label": "Create Block",
"imageLarge": "resources/createBlock.png",
"command": "myExtension.createBlock"
},
{
"id": "MbdSync.Menu",
"type": "Menu",
"label": "Update Block",
"imageLarge": "resources/blocks.png",
"controls": [
{
"id": "MbdSync.UpdateAllBlocks",
"type": "Button",
"imageSmall": "resources/updateAllBlocks.png",
"label": "Bulk Update",
"description": "Updates all blocks",
"command": "myExtension.updateAllBlocks"
},
{
"id": "MbdSync.Separator",
"type": "Separator"
},
{
"id": "MbdSync.UpdateBlock",
"type": "Button",
"imageSmall": "resources/updateBlock.png",
"label": "Update",
"description": "Updates the selected block",
"isEnabled": "IsBlockSelected",
"command": "myExtension.updateBlock"
}
]
},
{
"id": "MbdSync.StackPanel",
"type": "StackPanel",
"controls": [
{
"id": "MbdSync.UpdateAllBlocks",
"type": "Button",
"imageSmall": "resources/updateAllBlocks.png",
"label": "Bulk Update Blocks",
"description": "Updates all blocks",
"command": "myExtension.updateAllBlocks"
},
{
"id": "MbdSync.UpdateBlock",
"type": "Button",
"imageSmall": "resources/updateBlock.png",
"label": "Block Update",
"description": "Updates the selected block",
"isEnabled": "IsBlockSelected",
"command": "myExtension.updateBlock"
}
]
}
]
},
{
"id": "Code Gen",
"label": "Generate Source Code",
"controls": [
{
"id": "CodeGen.GenerateCode",
"type": "Button",
"label": "Generate Source Code",
"imageLarge": "resources/generate.png",
"command": "myExtension.generateCode"
}
]
}
]
}
]
},
"commands": [
{
"id": "myExtension.createBlock",
"execFunc": "createBlock"
},
{
"id": "myExtension.updateAllBlocks",
"execFunc": "updateAllBlocks"
},
{
"id": "myExtension.updateBlock",
"execFunc": "updateBlock"
},
{
"id": "myExtension.generateCode",
"execFunc": "generateCode"
}
]
}
}

Footnotes

  1. If the same ID as an existing component is specified, it will be merged into the same component. Otherwise, a new component will be created. 2 3 4 5 6 7 8 9 10

  2. Specifies the ID of a sibling element indicating the relative position. 2 3 4 5 6 7 8 9

  3. Set either imageSmall or imageLarge. The size of the displayed icon will be adjusted according to the layout in the ribbon. Set imageSmall for StackPanel elements. 2 3 4 5

  4. If the ID is the same as an existing component, specifying label is not necessary. 2

  5. Optional when placed under a button group. However, if no label is specified, specify either imageSmall or imageLarge.