Command-line utility to export colors, typography, icons, and images from Figma to Xcode, Android Studio, Flutter, and Web (React/TypeScript) projects.
Automatically sync your design system from Figma to code with support for Dark Mode, SwiftUI, UIKit, Jetpack Compose, Flutter, and React/TypeScript.
- Eliminate manual export: Figma doesn't natively export colors and images to Xcode/Android Studio
- Keep design and code in sync: Automate updates to your component library
- Save time: No more manual color palette management or icon exports
- ✨ Export light & dark color palettes
- 🎨 High contrast color support (iOS)
- 🖼️ Icons and images with Dark Mode variants
- 📄 PDF vector icons (resolution-independent, iOS)
- 🖥️ iPad-specific asset variants
- 📝 Typography with Dynamic Type support (iOS)
- 🔄 RTL (Right-to-Left) layout support
- 🎯 Figma Variables support
- 📱 SwiftUI and UIKit (iOS/macOS)
- 🔗 Figma Code Connect integration (iOS)
- 🤖 Jetpack Compose and XML resources (Android)
⚠️ Android pathData validation (errors on 32,767 bytes AAPT limit)- 🦋 Flutter / Dart
- 🌐 React / TypeScript (CSS variables, TSX components)
- 🔧 Customizable code templates (Stencil)
- 🖼️ PNG, SVG, PDF, JPEG, WebP, HEIC (with quality control)
- 📊 W3C Design Tokens (JSON export)
- ⚡ Quick fetch mode (no config file needed)
- ⚡ Parallel downloads & writes
- 📦 Batch processing with shared rate limiting
- 🔁 Automatic retries with exponential backoff
- 💾 Checkpoint/resume for interrupted exports
- 🕐 Version tracking (skip unchanged files)
- 🧬 Granular cache (per-node change detection, experimental)
- 🤖 CI/CD ready (quiet mode, exit codes, JSON reports)
- 🔄 GitHub Action for automated exports
- 📊 Rich progress indicators with ETA
- 🔇 Verbose, normal, and quiet output modes
- 🚀 Swift 6 / Strict Concurrency
Note: Exporting icons and images requires a Figma Professional/Organization plan (uses Shareable Team Libraries).
Tip: For optimal PNG sizes, use oxipng (
github:shssoichiro/oxipngviamise use -g) to compress exported PNG files after export.
# Using Homebrew (recommended)
brew install alexey1312/exfig/exfig
# Using Mint
mint install alexey1312/ExFig
# Using mise
mise use -g github:alexey1312/ExFigexport FIGMA_PERSONAL_TOKEN=your_token_hereGet your token from Figma's developer settings. For secure token
storage, consider using fnox instead of plain export.
exfig init -p ios # or: android, flutter, webEdit exfig.pkl and add your Figma file IDs:
figma {
lightFileId = "YOUR_FIGMA_FILE_ID"
}# Export individual resource types
exfig colors # Export colors
exfig icons # Export icons
exfig images # Export images
exfig typography # Export typography
# Export everything at once with batch
exfig batch exfig.pkl # All resource types from single configSee Configuration Reference for all available options.
YourProject/
├── Assets.xcassets/
│ ├── Colors/ # Color sets with Light/Dark variants
│ ├── Icons/ # PDF/SVG vector icons
│ └── Images/ # PNG images with @1x, @2x, @3x
└── Sources/
├── UIColor+extension.swift # Type-safe color access
├── Color+extension.swift # SwiftUI colors
├── UIImage+extension.swift # Image access
├── UIFont+extension.swift # Typography
└── Labels/ # Pre-configured UILabel classes
app/src/main/
├── res/
│ ├── values/
│ │ ├── colors.xml # Color definitions
│ │ └── typography.xml # Text styles
│ ├── values-night/
│ │ └── colors.xml # Dark mode colors
│ ├── drawable/ # Vector icons/images
│ └── drawable-xxxhdpi/ # Raster images (multiple DPIs)
└── java/.../ui/exfig/
├── Colors.kt # Compose colors
├── Icons.kt # Compose icons
└── Typography.kt # Compose text styles
flutter_project/
├── assets/
│ ├── icons/
│ │ ├── ic_add.svg # Light icons
│ │ └── ic_add_dark.svg # Dark icons
│ └── images/
│ ├── logo.png # 1x scale
│ ├── 2.0x/logo.png # 2x scale
│ └── 3.0x/logo.png # 3x scale
└── lib/
└── generated/
├── colors.dart # Color constants
├── icons.dart # Icon path constants
└── images.dart # Image path constants
Export all resource types (colors, icons, images, typography) from a single unified config:
exfig batch exfig.pkl # All resources from one config
exfig batch exfig.pkl --cache # With version trackingProcess multiple configuration files in parallel with shared rate limiting:
exfig batch ./configs/ # All configs in directory
exfig batch ios.pkl android.pkl flutter.pkl # Specific files
exfig batch ./configs/ --parallel 5 # Custom parallelism
exfig batch ./configs/ --report results.json # JSON reportSupports --fail-fast, --resume (checkpoint/resume), and --cache (version tracking). See
documentation for all options.
Download assets directly without a configuration file:
exfig fetch -f FILE_ID -r "Icons" -o ./icons --format svg
exfig fetch -f FILE_ID -r "Images" -o ./images --format webp --webp-quality 90Supports all formats (PNG, SVG, PDF, JPEG, WebP), filtering (--filter), name conversion (--name-style), and dark
mode variants (--dark-mode-suffix). Run exfig fetch --help for all options.
Export Figma data as W3C Design Tokens:
exfig download colors -o tokens/colors.json
exfig download icons -o tokens/icons.json --asset-format svg
exfig download all -o ./tokens/Skip unchanged exports using Figma file version tracking:
exfig colors --cache # Enable version tracking
exfig icons --cache --experimental-granular-cache # Per-node change detectionConfigure in exfig.pkl via common.cache or use CLI flags. See CONFIG.md for details.
All commands include automatic retries with exponential backoff, rate limit handling (respects Retry-After), and
checkpoint/resume for interrupted exports. Configurable via --max-retries, --rate-limit, --fail-fast, and
--resume.
Automate design exports in CI/CD with exfig-action:
- uses: alexey1312/exfig-action@v1
with:
figma_token: ${{ secrets.FIGMA_TOKEN }}
command: icons
cache: true- Swift 6.2+ (for building from source)
- macOS 13.0+ or Linux (Ubuntu 22.04)
- PKL - Configuration language (install via
brew install pklormise use -g pkl) - Figma Personal Access Token
Complete documentation is available at alexey1312.github.io/ExFig - including getting started guides, platform-specific export details, design requirements, and custom templates.
See CONFIG.md for the full configuration reference.
We welcome contributions! See the Development Guide for setup, testing, and code style guidelines.
ExFig is available under the MIT License. See LICENSE for details.
Read the full documentation | Report an issue | Figma API
Originally inspired by figma-export.