Vue Plugin Template for Figma
Features:
- Vue
- Typescript
- figma-plugin-ds integration
- Message handler helper functions to simplify communication between the main code and the UI code
How to use?
- Install dependencies with
npm i. - Run
npm run devand a folder nameddistwill be created. - In the Figma desktop app, click on Create new plugin / Link existing plugin and point it to the
manifest.jsonin this project. - Now you can edit the main Figma code from
src/code.tsand the UI code fromsrc/ui.vue. Hitting save will auto-reload the build so you can see your changes right away. - When you're ready to publish the plugin, run
npm run buildto create a production build.
Message handlers
To communicate between the main code and the UI code, you can use the dispatch and handleEvent functions to send and listen to messages between the two environments.
Sending a message from the main code to UI code:
dispatch('eventName', data)
Handling messages from the UI code to the main code:
handleEvent('eventName', data => {
// Do something with the data
})
Note that data is optional so you could simply send a message by dispatch('eventName').
In the vue UI code, dispatch can be called anywhere, but handleEvent functions should be called in mounted() so they would only be called first and only once.
This project template shows an example of a UI button sending a message to the main code to create a rectangle node. The main code then sends back the created node ID to be displayed in the UI.

Formed in 2009, the Archive Team (not to be confused with the archive.org Archive-It Team) is a rogue archivist collective dedicated to saving copies of rapidly dying or deleted websites for the sake of history and digital heritage. The group is 100% composed of volunteers and interested parties, and has expanded into a large amount of related projects for saving online and digital history.
