Get structured names of a ComponentSetNode [Figma API]
✓ Published0🌍 Public
KKevinGutowski
Last edited Jun 28, 2021
Created on Jun 27, 2021
This example converts a Figma ComponentSetNode into structured variant metadata. The `getVariantMetaData` function parses each child component’s name, splitting on commas and equals signs to extract property names and variant values. It then builds a JavaScript object that lists all detected properties and their unique variants, using arrays to track property order and avoid duplicates. The code relies on native string methods like `split` and array `indexOf` rather than external visualization libraries, focusing on data preprocessing for later charting.
AI-generated description