Main Content

mw.desktop.quickAccess Extension Point

Add items to quick access toolbar

Since R2025a

You can add items to the quick access toolbar using the mw.desktop.quickAccess extension point.

To add items to the quick access toolbar:

  1. Create a JSON-formatted file named extensions.json and place it in a folder named resources.

  2. Add the mw.schemaVersion property as the first property in the extensions.json file and set the value to the schema version for your MATLAB® release. For more information about schema versions, see Add Schema Version.

  3. Add a set of JSON declarations to extensions.json that defines one or more toolbar items using the mw.desktop.quickAccess extension point. Define custom items in an "items" array within the extension point.

  4. Add the folder containing the resources folder with the extensions.json file to the MATLAB path. To add the folder to the path, use the addpath function or right-click the folder in the Files panel and select Add to Path > Selected Folders and Subfolders.

This JSON code shows the basic structure of the mw.desktop.quickAccess extension point.

{
    "mw.schemaVersion": "1.0.0",
    "mw.desktop.quickAccess": {
        "items": [
            {
                "name": "mytoolbox.MyQAItem",
                "type": "PushButton",
                "action": {
                    "text": "Item 1",
                    "description": "My quick action item 1",
                    "icon": "./icons/Open_16.png",
                    "callback": "myQAItemFunction"
                }
            }
        ]
    }
}

When you add items to the quick access toolbar, they appear to the right of the Search box.

Toolstrip with a new push button in the quick access toolbar

For more information about using extension points, see Extend MATLAB Using Extension Points

Properties

expand all

Name of item to add, specified as a JSON string.

Type of item to add, specified as one of these values:

  • "PushButton" — Toolbar item that runs a specified callback when clicked.

Item action, specified as an object with these properties:

  • text — Item label, specified as a JSON string. If labels are not shown in the quick access toolbar, text becomes the item tooltip.

  • description — Item tooltip, specified as a JSON string. If labels are not shown in the quick access toolbar, text becomes the item tooltip instead of description.

  • (optional) icon — Item icon, specified as a JSON string. Specify icon as the path to a PNG, SVG, or JPG icon. The path must be relative to extensions.json. For example, "icon": "./myicon.svg".

  • callback — Custom MATLAB function to run when you click the toolbar item, specified as a JSON string. For more information on defining the MATLAB function, see Custom Defined MATLAB Function.

More About

expand all

Version History

Introduced in R2025a