Main Content

mw.fileTypes.icons Extension Point (Beta)

Add custom icons for file type

Since R2024b

Note

Extension points are available only as part of the new desktop for MATLAB®. The new desktop for MATLAB is in beta development and should not be used for development or production activities. For more information, see Get Started with the New Desktop for MATLAB (Beta).

You can add custom icons for different file types in MATLAB using the mw.fileTypes.icons extension point.

To add a custom icon for a file type in MATLAB:

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

  2. Add a set of JSON declarations to extensions.json that defines one or more icons.

  3. Add the folder containing the resources folder 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.fileTypes.icons extension point.

{
    "mw.fileTypes.icons": {
        "xlsx": "./excelWorksheetIcon.svg",
        "docx": "./wordDocIcon.svg"
    }
}

For more information about using extension points, see Extend MATLAB Using Extension Points (Beta).

Properties

expand all

Required Properties

File type icon to display in the Files panel for files with a specific extension, specified as a JSON string.

Specify the property name as the lowercase file type extension or file type group that you want to add an icon for. Specify the property value as the path to the PNG, SVG, or JPG icon to display for that file type extension. The path must be relative to extensions.json.

For example, to display the icon excelWorksheetIcon.svg for files with a .xlsx extension, use the JSON declaration "xlsx": "./excelWorksheetIcon.svg". For more information about file type groups, see mw.fileTypes.groups.

Version History

Introduced in R2024b