marcomontalbano / figma-export

Export tool for Figma. You can easily and automatically export your Figma components and use them directly into your website.
https://figma-export.marcomontalbano.com
MIT License
259 stars 33 forks source link

Add `includeTypes` attribute to support component instance #160

Closed marcomontalbano closed 9 months ago

marcomontalbano commented 9 months ago

Refers to #151

This PR aims to add the ability to include INSTANCE components to the export. By default, all COMPONENTs are exported, but now you can add the property includeTypes to the .figmaexportrc.js file:

...

['components', {
    fileId: 'fzYhvQpqwhZDUImRz431Qo',
    onlyFromPages: ['empty-page', 'icons', 'unit-test'],
    includeTypes: ['COMPONENT', 'INSTANCE'],
    ...
}]

Exporting via CLI is straightforward:

figma-export components fzYhvQpqwhZDUImRz431Qo -O @figma-export/output-components-as-svg -t INSTANCE