This is a boilerplate for creating a Figma plugin using React and Typescript.
- SASS (SCSS)
- CSS/SASS/SCSS Modules
- Typescript
- Import SVG images
@figma/plugin-typings: 1.68.0react: 18.2.0
├── src
│ ├── app
│ │ ├── assets
│ │ ├── components
│ │ ├── styles
│ ├── controller
│ ├── App.tsx
│ ├── index.tsx
│ ├── index.html
├── manifest.json
├── .prettierrc.yml
├── declaration.d.ts
├── tsconfig.json
├── webpack.config.js
This is where the main app is located. It is a React app that is rendered inside the Figma plugin.
This is where the Figma controller is located. It is a Typescript file that is used to communicate with the Figma API.
- Clone this repo
- Run
yarnornpm install - Run
yarn devornpm run dev - Go to Figma and add a new plugin (Plugins -> Development -> Import plugin from manifest…)
- Run the plugin
In the project directory, you can run:
yarn devornpm run devto run the app in the development mode.yarn buildornpm run buildto build the app for production to thebuildfolder.
- run
yarn buildornpm run buildbefore publishing the plugin to Figma. This will optimize the code and remove unnecessary files. - You'll need to restart plugin in Figma in order to see the changes during development.
- Do not forget to replace the name and id of the plugin in the
manifest.jsonfile before publication.
If you have any feedback, please reach out to me here in issues, or on Twitter.
