Export tool for Figma
You can easily and automatically export your figma components
and styles
and use them directly into your website
SVG into .js
data:image/svg+xml
The .js file contains all components as Data URL so you can easly put this value into the src of your images. This is the best way to load an svg as image.
module.exports = {
commands: [
['components', {
fileId: 'RSzpKJcnb6uBRQ3rOfLIyUs5',
onlyFromPages: ['icons', 'monochrome'],
outputters: [
require('@figma-export/output-components-as-es6')({
output: './output/es6-dataurl',
useDataUrl: true,
})
]
}]
]
}
Base 64
The .js file contains all components with Base 64 encoding. If you want to use it into your images you need to prepend the Data URL data:image/svg+xml;base64,
module.exports = {
commands: [
['components', {
fileId: 'RSzpKJcnb6uBRQ3rOfLIyUs5',
onlyFromPages: ['icons', 'monochrome'],
outputters: [
require('@figma-export/output-components-as-es6')({
output: './output/es6-base64',
useBase64: true,
})
]
}]
]
}
SVG Sprites
SVG Symbols
The .svg file contains all components as <symbol> so you can easly use an icon with<svg><use href="#icon-name" /></svg>
module.exports = {
commands: [
['components', {
fileId: 'RSzpKJcnb6uBRQ3rOfLIyUs5',
onlyFromPages: ['icons', 'monochrome'],
outputters: [
require('@figma-export/output-components-as-svgstore')({
output: './output/svgstore'
})
]
}]
]
}
Monochrome SVG Symbols
The .svg file contains all components as <symbol> and all fill
properties are removed from the svg so you can easily customize the icon color from css.
module.exports = {
commands: [
['components', {
fileId: 'RSzpKJcnb6uBRQ3rOfLIyUs5',
onlyFromPages: ['icons'],
outputters: [
require('@figma-export/output-components-as-svgstore')({
output: './output/svgstore-monochrome',
svgstoreConfig: {
cleanSymbols: ['fill']
}
})
]
}]
]
}
SVG into (p)React Component
React Components
You can easily import the generated .jsx
files into your project and start using your Figma components as React components.import { Squirrel } from './output/octicons-by-github';
module.exports = {
commands: [
['components', {
fileId: 'RSzpKJcnb6uBRQ3rOfLIyUs5',
onlyFromPages: ['octicons-by-github'],
outputters: [
require('@figma-export/output-components-as-svgr')({
output: './output'
})
]
}]
]
}
Solid Colors
Linear Gradients
Effects
Text
CSS Variables
css
file.body {
color: var(--color-3);
background: var(--color-linear-gradient);
font-family: var(--regular-test-font-family);
font-size: var(--regular-test-font-size);
}
module.exports = {
commands: [
['styles', {
fileId: 'RSzpKJcnb6uBRQ3rOfLIyUs5',
outputters: [
require('@figma-export/output-styles-as-css')({
output: './output/css',
})
]
}]
]
}
SASS
and SCSS
_variables.scss
and use it.body {
color: $color-3;
background: $color-linear-gradient;
font-family: map-get($regular-text, "font-family");
font-size: map-get($regular-text, "font-size");
}
module.exports = {
commands: [
['styles', {
fileId: 'RSzpKJcnb6uBRQ3rOfLIyUs5',
outputters: [
require('@figma-export/output-styles-as-sass')({
output: './output/scss',
}),
require('@figma-export/output-styles-as-sass')({
output: './output/sass',
getExtension: () => 'SASS',
})
]
}]
]
}
LESS
_variables.less
and use it.body {
color: @color-3;
background: @color-linear-gradient;
font-family: #regular-text[font-family];
font-size: #regular-text[font-size];
}
module.exports = {
commands: [
['styles', {
fileId: 'RSzpKJcnb6uBRQ3rOfLIyUs5',
outputters: [
require('@figma-export/output-styles-as-less')({
output: './output/less',
})
]
}]
]
}