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.
- ⚡️ Lightning Fast Development with Vite
- 🎨 Beautiful UI Components with Shadcn/ui
- 🎯 TypeScript Support with Figma Plugin Types
- 🎭 Tailwind CSS for Utility-First Styling
- 🔥 Hot Module Replacement (HMR)
- 📦 Optimized Build Size
- 🎯 Type-Safe Message Passing
- 🔧 Easy Configuration
- 📱 Responsive Design Support
- 🌙 Dark Mode Support
- 🚀 Production-Ready Setup
- React - UI Library
- Vite - Build Tool
- Tailwind CSS - CSS Framework
- Shadcn/ui - UI Components
- TypeScript - Type Safety
- Figma Plugin API - Figma Integration
- Node.js 18 or later
- Package manager (npm, yarn, or pnpm)
- Figma Desktop App
- Basic knowledge of React and TypeScript
-
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
- Clone the repository:
git clone https://github.com/aleksihuusko/figma-plugin-boilerplate.git
cd figma-plugin-boilerplate
- Install dependencies:
# Using npm
npm install
# Using yarn
yarn
# Using pnpm
pnpm install
- Start development:
# Using npm
npm run dev
# Using yarn
yarn dev
# Using pnpm
pnpm dev
- Build for production:
# Using npm
npm run build
# Using yarn
yarn build
# Using pnpm
pnpm build
- Open Figma Desktop App
- Go to Plugins > Development > Import plugin from manifest...
- Select the
manifest.json
file from thedist
directory - Your plugin will now appear in the development plugins menu
figma-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
- Install a component:
pnpm dlx shadcn-ui@latest add button
- Use the component in your React code:
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:
- Go to Plugins > Development > Hot Reload Plugin
-
View Console Logs:
- Go to Plugins > Development > Show/Hide Console
-
Debug Your Plugin:
- Use Chrome DevTools for UI debugging
- Use Figma Console for plugin code debugging
- Create a production build:
npm run build
- The build output will be in the
dist
directory:manifest.json
- Plugin manifestcode.js
- Plugin codeui.html
- UI code
Contributions 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.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature
) - Commit your changes (
git commit -m 'Add some AmazingFeature'
) - Push to the branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
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!
- Figma Plugin API
- Vite
- Tailwind CSS
- Shadcn/ui
- React
- Bolt Figma - The original boilerplate that inspired this template
- Figma Plugin API Documentation - Official Figma Plugin API documentation
- Figma Plugin API Reference - Complete API reference
- Figma Plugin Examples - Official examples and tutorials