1.0.2 • Published 4 years ago
figma-portal v1.0.2
Simple way to export a Figma components by name:ok_hand:
figma-portal is your choice:
- If you use and strictly adhere to the naming policy in component library
- Explaining to the designer where to get the
nodeId,teamIdorfileKeyis too difficult
Install
npm install figma-portal --save-devUsage
figma-portal extract -d DEFAULT_OUTPUT_DIR -p PROJECT_NAME -c .figma.ymlEnvironment variables
FIGMA_TOKEN- Personal or OAuth tokenFIGMA_TEAM_ID- Id of the team to list projects from
Configuration
Create a config file - .figma.yml, and add a new description for the exported components:
# Unique name of the component within the project
- name: GitHub / Figma portal / Logo
# Output directory if different from default
outputDir: media
# Output file name, if necessary (by default uses the name of the component)
fileName: banner
# A string enum for the image output format, can be jpg, png, svg, or pdf
format: svg
# A number between 0.01 and 4, the image scaling factor
scale: 1API
Read the API documentation for more information.