π¨ React Boilerplate for Figma plugins βοΈ

β What is this?
This is a boilerplate for creating a Figma plugin using React and Typescript.
Supports
- SASS (SCSS)
- CSS/SASS/SCSS Modules
- Typescript
- Import SVG images
π¦ Latest packages versions
@figma/plugin-typings: 1.68.0react: 18.2.0
Structure
βββ src
β βββ app
β β βββ assets
β β βββ components
β β βββ styles
β βββ controller
β βββ App.tsx
β βββ index.tsx
β βββ index.html
βββ manifest.json
βββ .prettierrc.yml
βββ declaration.d.ts
βββ tsconfig.json
βββ webpack.config.js
src/app
This is where the main app is located. It is a React app that is rendered inside the Figma plugin.
src/controller
This is where the Figma controller is located. It is a Typescript file that is used to communicate with the Figma API.
π οΈ How to use
- 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
βοΈ How to run
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.
β Important
- 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.
π£ Feedback
If you have any feedback, please reach out to me here in issues, or on Twitter.