Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

SVG Profile

Purpose

The profile is designed for importing SVG assets from Figma.

The asset import process consists of the following stages:

  1. Fetch Figma remote: REST API reference
  2. Locate the node ID by the specified name
  3. Request SVG export from Figma using the node ID: REST API reference
  4. Download the exported SVG file

Complete Configuration in .figtree.toml

[profiles.svg]
# ID from the [remotes] section. 
# Uses the default remote if unspecified, but can reference any configured remote
remote = "some_remote_id"
# Target directory for downloaded assets. 
# Defaults to empty (root package directory where .fig.toml resides)
output_dir = "some_dir"
# Specifies which variants to use. Only the listed keys will be processed.
# Can be overridden in .fig.toml for each resource
variants.use = ["L", "M", "S"]
# Available variants
# output_name - filename for the exported file
# figma_name - node name in Figma to look for
variants.L = { output_name = "{base}L", figma_name = "{base}_24" }
variants.M = { output_name = "{base}M", figma_name = "{base}_20" }
variants.S = { output_name = "{base}S", figma_name = "{base}_16" }
variants.XS = { output_name = "{base}XS", figma_name = "{base}_12" }