6.0.1 • Published 1 year ago

@figma-export/output-components-as-svg v6.0.1

Weekly downloads
121
License
MIT
Repository
github
Last release
1 year ago

@figma-export/output-components-as-svg

Outputter for @figma-export that exports components as svg.

With this outputter you can export all components as svg into the specified output folder.

This is a sample of the output from this Figma file:

$ tree output/
# output
# ├── icons
# │   ├── figma-arrow.svg
# │   ├── figma-export.svg
# │   └── figma-logo.svg
# └── unit-test
#     ├── figma
#     │   ├── logo
#     │   │   ├── main (bright).svg
#     │   │   └── main.svg
#     │   └── logo.svg
#     └── figma default logo.svg

Tip: A component named icon/eye will be exported as eye.svg inside the icon folder.

.figmaexportrc.js

You can easily add this outputter to your .figmaexportrc.js:

import asSvg from '@figma-export/output-components-as-svg'

export default {
    commands: [
        ['components', {
            fileId: 'fzYhvQpqwhZDUImRz431Qo',
            onlyFromPages: ['icons', 'unit-test'],
            outputters: [
                asSvg({
                    output: './output'
                })
            ]
        }],
    ]
}

output is mandatory.

getDirname and getBasename are optional.

import asSvg from '@figma-export/output-components-as-svg'
import path from 'path'

...

asSvg({
    output: './output',
    getDirname: (options) => `${options.pageName}${path.sep}${options.dirname}`,
    getBasename: (options) => `${options.basename}.svg`,
})

defaults may change, please refer to ./src/index.ts

Install

Using npm:

npm install --save-dev @figma-export/output-components-as-svg

or using yarn:

yarn add @figma-export/output-components-as-svg --dev
6.0.1

1 year ago

6.0.0

1 year ago

6.0.0-beta.0

1 year ago

5.0.1

1 year ago

5.0.0

1 year ago

4.8.0

1 year ago

4.8.0-alpha.4

1 year ago

4.8.0-alpha.1

1 year ago

4.8.0-alpha.2

1 year ago

4.8.0-alpha.3

1 year ago

4.8.0-alpha.0

1 year ago

4.7.0

2 years ago

4.7.0-alpha.0

2 years ago

4.6.0

2 years ago

4.5.0

3 years ago

4.4.0

3 years ago

4.0.0-alpha.1

4 years ago

4.0.1

4 years ago

4.0.0

4 years ago

4.2.0

3 years ago

4.0.0-alpha.0

4 years ago

3.5.0

4 years ago

3.4.0

4 years ago

3.3.1

4 years ago

3.3.0

4 years ago

3.2.0

5 years ago

3.1.0

5 years ago

3.0.0

5 years ago

3.0.0-alpha.5

5 years ago

3.0.0-alpha.4

5 years ago

3.0.0-alpha.3

5 years ago

3.0.0-alpha.2

5 years ago

3.0.0-alpha.1

5 years ago

3.0.0-alpha.0

5 years ago

2.2.0

5 years ago

2.1.0

5 years ago

2.0.0

5 years ago

2.0.0-alpha.3

5 years ago

2.0.0-alpha.0

5 years ago

2.0.0-alpha.1

5 years ago

1.2.0

5 years ago

1.1.1

5 years ago

1.0.0

6 years ago

0.0.1-alpha.12

6 years ago

0.0.1-alpha.11

6 years ago

0.0.1-alpha.9

6 years ago

0.0.1-alpha.8

6 years ago

0.0.1-alpha.6

6 years ago

0.0.1-alpha.5

6 years ago

0.0.1-alpha.4

6 years ago

0.0.1-alpha.3

6 years ago

0.0.1-alpha.0

6 years ago