A modern, production-ready boilerplate for building Figma Plugins using React, Vite, Tailwind CSS, and Shadcn/ui. This template provides a robust foundation for creating beautiful and functional Figma plugins with a modern tech stack.
Note: This boilerplate is built on top of the Figma Plugin API. Make sure to check out the official documentation for detailed information about the Plugin API capabilities and limitations.
Install Node.js 18 or later
Install your preferred package manager:
# Using npm (comes with Node.js)
npm --version
# Using yarn
npm install -g yarn
yarn --version
# Using pnpm
npm install -g pnpm
pnpm --version
Install Figma Desktop App
git clone https://github.com/aleksihuusko/figma-plugin-boilerplate.git
cd figma-plugin-boilerplate
# Using npm
npm install
# Using yarn
yarn
# Using pnpm
pnpm install
# Using npm
npm run dev
# Using yarn
yarn dev
# Using pnpm
pnpm dev
# Using npm
npm run build
# Using yarn
yarn build
# Using pnpm
pnpm build
manifest.json
file from the dist
directoryfigma-plugin-boilerplate/
├── src/ # Frontend source code
│ ├── components/ # React components
│ ├── lib/ # Utility functions
│ ├── styles/ # Global styles
│ └── main.tsx # Entry point
├── src-code/ # Figma plugin code
│ └── code.ts # Plugin logic
├── public/ # Static assets
├── dist/ # Build output
└── vite.config.ts # Vite configuration
pnpm dlx shadcn-ui@latest add button
import { Button } from '@/components/ui/button'
export function MyComponent() {
return <Button>Click me</Button>
}
The boilerplate includes type-safe message passing between the UI and plugin code:
// In your UI code
import { dispatchTS } from '@/lib/utils'
dispatchTS('myEvent', { data: 'value' })
// In your plugin code
import { listenTS } from '@/lib/utils'
listenTS('myEvent', (data) => {
console.log(data.value)
})
Enable Hot Reload in Figma:
View Console Logs:
Debug Your Plugin:
npm run build
dist
directory:manifest.json
- Plugin manifestcode.js
- Plugin codeui.html
- UI codeContributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
git checkout -b feature/AmazingFeature
)git commit -m 'Add some AmazingFeature'
)git push origin feature/AmazingFeature
)This project is licensed under the MIT License - see the LICENSE file for details.
If you find this boilerplate helpful, please consider giving it a star ⭐️ on GitHub!