Understand how variant properties like boolean and enum help create interactive and flexible UI components in Figma for BI dashboards.
Variant properties (boolean, enum) in Figma - Dashboard Guide
| Component | Property Type | Property Name | Possible Values |
|---|---|---|---|
| Button | Boolean | Is Active | true, false |
| Button | Enum | Size | Small, Medium, Large |
| Toggle Switch | Boolean | On/Off | true, false |
| Card | Enum | Status | Default, Highlighted, Disabled |
| Icon | Boolean | Visible | true, false |
| Icon | Enum | Type | Info, Warning, Error |
- KPI Card: Shows a button with
Is Activeboolean property toggled on/off to reflect active state. - Size Selector: Dropdown using
Sizeenum property to switch button sizes (Small, Medium, Large). - Toggle Switch: Boolean property
On/Offcontrolling switch state visually. - Status Card: Uses
Statusenum property to show different card styles (Default, Highlighted, Disabled). - Icon Display: Boolean
Visibleproperty toggles icon visibility; enumTypechanges icon style (Info, Warning, Error).
+-------------------+-------------------+ | KPI Card | Size Selector | | (Boolean Active) | (Enum Size) | +-------------------+-------------------+ | Toggle Switch | Status Card | | (Boolean On/Off) | (Enum Status) | +-------------------+-------------------+ | Icon Display (Boolean Visible + Enum Type) | +--------------------------------------------------------+
Changing the Is Active boolean toggles the button style in KPI Card.
Selecting a size from the Size enum dropdown updates the button size in the KPI Card.
Toggling the On/Off boolean changes the switch's visual state.
Choosing a Status enum value updates the card's background and border style.
Switching Visible boolean shows or hides the icon; selecting Type changes the icon's symbol and color.
If you toggle the Is Active property to false, which components update their appearance?
- The KPI Card button changes to inactive style.
- No other components change because they depend on different properties.
Practice
What is the main purpose of variant properties in Figma components?
Solution
Step 1: Understand variant properties
Variant properties allow you to manage multiple versions of a component in one place.Step 2: Identify the benefit
This avoids creating many duplicate components and keeps design organized.Final Answer:
To create different versions of a component without duplicating it -> Option AQuick Check:
Variant properties = different versions without duplicates [OK]
- Thinking variants add animations
- Confusing variants with export options
- Believing variants change colors automatically
Which of the following is the correct way to define a boolean variant property in Figma?
{
"property": "isActive",
"type": "boolean",
"values": [true, false]
}Solution
Step 1: Check property type
The type is set to "boolean", which is correct for true/false values.Step 2: Check values array
The values array contains true and false, which are the two valid boolean options.Final Answer:
Correct syntax for a boolean variant property -> Option BQuick Check:
Boolean variant = true/false values [OK]
- Using strings instead of boolean true/false
- Adding more than two values for boolean
- Using numbers as property names
Given this enum variant property definition:
{
"property": "size",
"type": "enum",
"values": ["small", "medium", "large"]
}What will be the selected variant if the property size is set to "medium"?
Solution
Step 1: Understand enum variant property
Enum properties let you pick one option from a list of named values.Step 2: Check the selected value
Setting size to "medium" selects the variant with that exact value.Final Answer:
The component variant with size set to "medium" will be shown -> Option AQuick Check:
Enum property selects one named option [OK]
- Confusing enum with boolean type
- Expecting multiple variants to show
- Assuming default is always first value
Identify the error in this variant property definition:
{
"property": "visible",
"type": "boolean",
"values": ["true", "false"]
}Solution
Step 1: Check boolean values
Boolean variant values must be the boolean literals true and false, not strings.Step 2: Identify the mistake
Using "true" and "false" as strings is incorrect syntax for boolean type.Final Answer:
Boolean values should be true and false without quotes -> Option CQuick Check:
Boolean values = true/false literals [OK]
- Using strings instead of boolean literals
- Changing property name unnecessarily
- Confusing boolean with enum type
You want to create a Figma component with a variant property theme that can be either "light" or "dark", and another boolean variant property disabled. How should you define these variant properties?
Solution
Step 1: Define enum property for theme
The theme property has multiple named options, so it should be an enum with values "light" and "dark".Step 2: Define boolean property for disabled
The disabled property is true or false, so it should be boolean with values true and false.Final Answer:
{ "property": "theme", "type": "enum", "values": ["light", "dark"] }, { "property": "disabled", "type": "boolean", "values": [true, false] } -> Option DQuick Check:
Enum for multiple options, boolean for true/false [OK]
- Mixing enum and boolean types incorrectly
- Using strings for boolean values
- Assigning wrong values to properties
Ready to prove it?
Pass the test and this pattern moves unknown
