The Figma source is used to pull individual design patterns from Figma projects. The source subscribes to Figma project groups, then extracts from project files, tagged patterns.

A Figma pattern tag is defined within a Figma project's sharedPluginData.

For each retrieved/tagged pattern, a page is created in the Mosaic file-system. Additional Mosaic metadata can be added, to each created page, using meta For instance we could add metadata which defines which product owns a particular pattern and then group patterns based on owner.

yarn add @jpmorganchase/mosaic-source-figma

The Figma source is an HttpSource and shares the same base configuration. The transformResponseToPagesModulePath prop has a default transformer which creates a page for each matching Story.

PropertyDescriptionRequired
prefixDirpath to store figma patternsYes
figmaTokenfigma access tokenYes
projectsarray of projects to subscribe toYes
endpointsfigma endpointsYes

Each project is configured from the projects array.

PropertyDescriptionRequired
idnumerical id of the subscribed project groupYes
metametadata to add to each of the projects pagesYes
patternPrefixprefix to add to all pages createdYes

endpoints defined the Figma REST API endpoints.

PropertyDescriptionRequired
getProjecturl to return a list of projects within the project groupYes
getFileurl to return a project fileYes
generateThumbnailurl to generate a thumbnail for the shared Figma nodeYes
Mosaic BETA

Coming soon