Hello,
I have a noob question, I could access to components by their Key, but I couldn’t find a way to do that for variants, If anyone know how to do it?
That’s what i use for importing component to a page:
function current(componentKey) {
return __awaiter(this, void 0, void 0, function* () {
let page = figma.root.findChild((n) => n.name === " Current situation");
let component = yield figma.importComponentByIDAsync(componentKey);
page.appendChild(component.createInstance());
});
}
function setTemplate() {
return __awaiter(this, void 0, void 0, function* () {
setPages();
yield current(“a65cc984884ca221229bfb2686bb69770cdc4edf”);
});
}
I would like to do the same by importing variants instead of just component.
Thanks in advance for any help 🙏