Skip to main content

Widget Manifest

Each widget must define a manifest.json file. If you use the "Create new widget" option, Figma will automatically create a simple manifest for you.

Here’s an example of a widget manifest file:

info

This file is similar to the plugin manifest with the additional containsWidget and widgetApi properties and without plugin-specific options like menus or relaunchButtons.

manifest.json
{
"name": "MyWidget",
"id": "737805260747778093",
"api": "1.0.0",
"widgetApi": "1.0.0",
"editorType": ["figma", "figjam"],
"containsWidget": true
"main": "code.js",
"ui": "ui.html"
}

name: string

The name of the widget, as it will appear in the menu.


id?: string

The widget ID to publish updates to. This ID will be assigned to you by Figma and is typically obtained using the "Create new Plugin" feature, which will generate a manifest file with a new id. You can also get a new plugin ID at the time of publishing your plugin.


widgetApi: string

The version of the widget API used by the widget. The current widgetApi version is "1.0.0". In the future, when there are more versions of the widget API, this will be used to ensure stability across widget versions. See Stability and Updates for more information about updates to the api.

We recommend updating to the latest version whenever possible to get the latest features, bug fixes, and documentation.


containsWidget: true

All widget manifests should have this set to true.


editorType: ('figma' | 'figjam')[]

This allows you to specify the editor that your widget is intended for and will impact which editor your widget appears in.

The types we support currently are:

"editorType": ["figma"]
"editorType": ["figjam"]
"editorType": ["figma", "figjam"]

main: string

The relative file path to the JavaScript code of your widget.


ui?: string | { [key: string]: string }

Used to specify HTML file/files that can be used in the iframe modal via figma.showUI, if you choose to have one.

  • If a single string is specified, this is the relative file path to the HTML file whose contents will be available as a string in the Javascript code via the constant __html__.
  • If a map is specified, each entry of the map will be available at __uiFiles__

build?: string

Experimental! A shell command to run before we load the file specified in main and ui. This can be used to call build commands such as compiling with Typescript, running Webpack, etc. The command is run in the directory of the manifest.


Plugin API Specific Options

Here are some plugin specific manifest options that are also applicable to widgets:

api: string

The version of the Figma Plugin API used by the widget. We recommend updating to the latest version whenever possible to get the latest features, bug fixes, and documentation.


permissions?: PermissionType[]

This allows you to specify what permissions your widget wants access to.

type PermissionType =
"currentuser" |
"activeusers"
info

activeuser must be specified if your widget uses figma.activeUser and currentuser must be specified if your widget uses figma.currentUser.


enableProposedApi?: boolean

See Plugin Proposed API.

caution

This flag is only meant for development, and will not work in published widgets!


enablePrivatePluginApi?: boolean

This enables Plugin API that's specific to private widgets. Setting this will also enable local widgets to work with these APIs during development.