Hi All,
I’m learning Figma (coming from Sketch and Adobe XD), and I’m trying to build a button component with multiple variants and use variables + modes to dynamically set height.
I have create a page called Button Variants, and I have a component called Button (still learning the terminology of Figma. It has a purple hollow diamond icon), and I have 15 variants for a Primary button. I have defined the following properties and I’m using Font Awesome 7
- Type: TPrimary] {Variant}
- State: tDefault, Hover, Active, Focus, Disabled] {Variant}
- SizeL iSmall, Medium, Large] {Variant}
- Leading Icon: True {Boolean}
- Icon: plus {text}
- Button Label: text {text}
- Trailing Icon: True {Boolean}
- Icon2: caret-down {text}
The structure of my button compoent is:
Primary, Default, Small
├── leadingIcon (Frame)
│ └── icon (Text)
├── buttonLabel (Frame)
│ └── label (Text)
├── trailingIcon (Frame)
└── icon2 (Text)
I have also defined a variable collection called Button Size Tokens with the following values:
Name: button-size-height
Small: 32
Medium: 40
Large: 48
I then applied this variable (button-size-height) to set the height of each button variant. The issue is:
The height always uses the “Small” value, even when the variant property Size is set to Medium or Large.
What is not working:
-
I don’t see any dropdown to connect the Size variant to the variable mode.
-
The variable mode always defaults to “Small” regardless of which variant is selected.
-
When I try to link it, there’s no “Set mode property…” option in the variables panel or context menu.
-
I confirmed that:
-
I’m working in a Team Project, not Drafts.
-
The variable collection is saved and editable.
-
I can publish as a library, but I don’t see any difference.
-
Changing the default mode only affects the default height used.
-
What I’m trying to do
I want the button height to respond to the Size variant:
-
Small → 32
-
Medium → 40
-
Large → 48
…automatically, by linking the Size variant to the mode column of the variable. I think the is that Figma does not see the connection between the Size property and the variable.