Complete the code to create a variant with a specific property value.
const button = figma.createComponent();
button.variantProperties = { 'Size': [1] };Setting the variant property 'Size' to 'Large' correctly assigns the size variant.
Complete the code to access the variant property named 'Color'.
const variantColor = component.variantProperties[[1]];Accessing the 'Color' property retrieves the current color variant of the component.
Fix the error in setting multiple variant properties at once.
component.variantProperties = [1];The variantProperties must be an object with string keys and string values, both quoted properly.
Fill both blanks to create a variant matrix with two properties: Size and Color.
const variantMatrix = {
[1]: ['Small', 'Medium', 'Large'],
[2]: ['Red', 'Green', 'Blue']
};The variant matrix keys must match the variant property names exactly: 'Size' and 'Color'.
Fill all three blanks to set variant properties and retrieve a variant node by matching properties.
component.variantProperties = { [1]: 'Medium', [2]: 'Green' };
const variantNode = component.findVariant({ [1]: 'Medium', [3]: 'Green' });Both setting and finding variants require the exact property names. 'Size' and 'Color' are used consistently.