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
yarn
ornpm install
- Run
yarn dev
ornpm 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 dev
ornpm run dev
to run the app in the development mode.yarn build
ornpm run build
to build the app for production to thebuild
folder.
- run
yarn build
ornpm run build
before 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.json
file before publication.
If you have any feedback, please reach out to me here in issues, or on Twitter.