A powerful Figma plugin that generates React/TypeScript code from Figma designs and manages Devup design system configurations. This plugin enables seamless conversion of Figma components to production-ready React code and facilitates design system synchronization.
- React Component Generation: Automatically converts Figma designs to React/TypeScript components using the Devup-UI format
- Codegen Support: Works with Figma's Dev Mode codegen feature for real-time code preview
- Component Extraction: Extracts and generates code for nested components
- CLI Export: Generates bash commands for easy file creation
- Export Devup Config: Export your design system (colors, typography, components) in JSON or Excel format
- Import Devup Config: Import design system configurations back into Figma
- Treeshaking Support: Optimize exports by removing unused design tokens
- Variable Support: Handles Figma variables and color collections with multiple modes
- Component Export: Export selected components as a ZIP file containing individual component files
- Asset Export: Export design assets (currently in development)
- Bun (recommended) or Node.js
- Figma Desktop App (for plugin development)
- Clone the repository:
git clone <repository-url>
cd devup-figma-plugin- Install dependencies:
bun install- Build the plugin:
bun run build- Load the plugin in Figma:
- Open Figma Desktop
- Go to
PluginsβDevelopmentβImport plugin from manifest... - Select the
manifest.jsonfile from this project
bun run dev- Start development server with hot reloadbun run build- Build the plugin for productionbun run watch- Build the plugin in watch modebun run test- Run tests with coveragebun run lint- Check code for linting errorsbun run lint:fix- Fix linting errors automatically
src/
βββ code.ts # Main plugin entry point
βββ codegen/ # Code generation logic
β βββ Codegen.ts # Main codegen class
β βββ props/ # Property generators (layout, colors, etc.)
β βββ render/ # Component rendering logic
β βββ utils/ # Codegen utilities
βββ commands/ # Plugin commands
β βββ devup/ # Devup export/import functionality
β βββ exportAssets.ts # Asset export command
β βββ exportComponents.ts # Component export command
βββ utils/ # Shared utilities
- Open Figma in Dev Mode
- Select a design element (frame, component, etc.)
- The plugin will automatically generate React/TypeScript code in the code panel
- You can copy the generated code or use the provided CLI commands
- Select elements in your Figma file
- Go to
PluginsβDevupβExport Devup(orExport Devup Excel) - Choose whether to use treeshaking (removes unused tokens)
- The configuration file will be downloaded
- Go to
PluginsβDevupβImport Devup(orImport Devup Excel) - Select your Devup configuration file
- The design system will be imported into Figma
- Select the components you want to export
- Go to
PluginsβDevupβExport Components - A ZIP file containing all component files will be downloaded
The plugin converts Figma nodes to React components by:
- Analyzing layout properties (auto-layout, padding, spacing)
- Converting styles (colors, typography, effects)
- Handling component variants and instances
- Generating proper TypeScript types
- Optimizing CSS properties
- β Auto Layout
- β Components & Variants
- β Text Styles & Typography
- β Color Variables & Collections
- β Effects (shadows, blurs)
- β Borders & Strokes
- β Grid Layouts
- β Transform properties
- Bundler: Rspack
- Language: TypeScript
- Linter: Biome
- Test Runner: Bun
- Package Manager: Bun
Run tests with coverage:
bun run testTest coverage reports are generated in the coverage/ directory.
- Follow the existing code style (enforced by Biome)
- Write tests for new features
- Ensure all tests pass and linting checks succeed
- Update documentation as needed
[Add your license information here]
For issues, questions, or contributions, please open an issue or contact the maintainers.