VarVar is a Figma plugin that allows you to export your Figma variables to JSON, CSV, CSS, or JavaScript formats, making it easier to integrate your design tokens into your development workflow.
- Multiple Export Formats: Export Figma variables to JSON, CSV, CSS (vanilla or Tailwind CSS v4), or JavaScript
- Format-Specific Menu Commands: Direct access to each export format from the Figma menu
- Linked Variable Support: Identifies and properly handles linked variables across formats
- Preview & Copy: Preview exported data and easily copy to clipboard
- Automatic Downloads: Exported files are automatically downloaded
- Row/Column Positioning: CSV option for spreadsheet formula-like linking
- JSON: Linked variables start with
$.VARIABLE.PATH - JavaScript: Linked variables are referenced directly like
collection.mode.variable- Numeric paths are converted to bracket notation:
collection.mode["500"]
- Numeric paths are converted to bracket notation:
- CSV: Linked variables start with
=VARIABLE/PATH- Option: Use row & column positions to produce formula-like linking (i.e.
=E7) in spreadsheet programs
- Option: Use row & column positions to produce formula-like linking (i.e.
- CSS: Linked variables use CSS custom property syntax:
--var-name: var(--VARIABLE) - Tailwind CSS: Linked variables use CSS custom property syntax with Tailwind naming conventions
Note: When dealing with linked variables that have multiple modes, the plugin will only link to the first occurrence (i.e., the first mode).
- Open Figma and go to the Community tab
- Search for "VarVar"
- Click on the plugin and then click "Install"
Access format-specific exports directly from the Figma menu:
- Open your Figma file containing variables
- Go to Plugins → VarVar → Choose your format:
- Export as JSON - Structured JSON data with nested groups
- Export as JavaScript - JavaScript objects with proper references
- Export as CSV - Spreadsheet-compatible data
- Export as CSS - CSS custom properties for web development
- Tailwind CSS or vanilla - Tailwind CSS format with
@themedirective (BETA)
- Tailwind CSS or vanilla - Tailwind CSS format with
- Configure filename and options (if applicable)
- Click "Export Variables"
- The exported file will be automatically downloaded
For format selection within the interface:
- Open your Figma file containing variables
- Go to Plugins → VarVar → Export Variables
- Choose your desired export format
- Configure filename and options
- Click "Export Variables"
- The exported file will be automatically downloaded
- Toggle the "Preview output" switch to see the exported data within the plugin interface
- Use the "Select to Copy" button and copy (Ctrl/Cmd + C) the exported data to your clipboard
Note: Programmatically copying is currently not supported by Figma Plugin APIs.
VarVar is built with a modular architecture for maintainability and scalability:
- Type System: Strict TypeScript enums and interfaces for type safety
- UI Components: Reusable React components for consistent interface
- Format Views: Dedicated views for each export format
- Export Utilities: Format-specific processing functions with JSDoc documentation
src/
├── components/ # Reusable UI components
│ ├── PluginDialogShell.tsx # Layout shell with padding and footer
│ ├── ExportHeader.tsx
│ ├── ExportLayout.tsx
│ ├── FilenameInput.tsx
│ ├── ExportButton.tsx
│ ├── OutputPreview.tsx
│ ├── ExportOptions.tsx
│ └── Footer.tsx
├── hooks/ # Custom React hooks
│ └── useExportData.ts # Hook for managing export data and state
├── views/ # Format-specific export views
│ ├── ExportView.tsx # Generic export with format selector
│ ├── ExportJSON.tsx
│ ├── ExportCSV.tsx
│ ├── ExportCSS.tsx
│ └── ExportJS.tsx
├── utils/ # Export processing utilities
│ ├── collectionToJSON.ts
│ ├── collectionToCSV.ts
│ ├── collectionToCSS.ts
│ ├── collectionToJS.ts
│ ├── collectionToTailwind.ts
│ ├── clipboard.ts
│ ├── color.ts
│ └── stringTransformation.ts
├── types.d.ts # TypeScript definitions and enums
├── code.ts # Plugin main logic
└── ui.tsx # UI router and main app
To set up the development environment:
- Clone the repository
- Install dependencies:
npm install - Run the development server:
npm run dev
To build the plugin for production:
npm run build
VarVar is developed and maintained by Atropical AS.