Skip to main content
adamlunn
Mar 23, 2021 10:18 AM UTC

Conditional Variant Properties

Variants have become one of the most important features I use within Figma. They are incredibly powerful! As they are so useful, I find myself looking for the ability to have properties show ONLY when another property is a certain value.

A quick example of what I mean is like this:

Let’s assume you have a button, and the top level of the properties are set up to be Primary and Secondary:

Let’s now assume I have an icon added to my buttons, but they are ONLY available to my Secondary button:

It would be so helpful here if this was possible:

  1. Select “Secondary” as my Property on the button variant.
  2. When “Secondary” is the active Property, I can then see ANOTHER Property where I can choose the icon for this example.
  3. That icon Property is only visible because I have said that it belongs to the “Secondary” Property.

Apologies if I have not explained this very well, but I think this could really be helpful when working with Variants.

27 replies

Gleb
Power Member
Mar 23, 2021 10:19 AM UTC

You can already do that, just delete the unnecessary variant, in your case the secondary button without the icon.

adamlunn
adamlunnAuthor
Mar 23, 2021 10:27 AM UTC

Sorry, it’s hard to explain with text.

In this example, both Primary and Secondary buttons can have no icons, or Secondary buttons can only have an icon.

I was hoping to have one button in my Library, when I drag it onto the canvas, I see the following variant choices:

Status

  • Primary
  • Secondary

I was then hoping that when I select “Secondary”, an additional Variant row appears to choose the icon, if I want one.

Status

  • Primary
  • Secondary - Chosen
    — Icon: Add
Gleb
Power Member
Mar 23, 2021 10:41 AM UTC

Got it, you want the variant value change button to appear or disappear based on the available variants, that makes sense.

Antoine
Active Member
Mar 30, 2021 1:42 PM UTC

Yes please, I’m building a design system for non-designers, and that would be a dream.
Currently I have to create multiple Variants to avoid impossible situations or just leave my user to understand why a certain set of properties is impossible to achieve.

Hide/show of conditionnal properties or even enabled/disabled would solve it.

Lyubomir_Popov
Sep 10, 2021 10:18 AM UTC

Is there a feature request tracker where we can track any progress of something like this? This is an essential feature, I’m surprised to find it is not available.

Andrei_Iancu
Sep 10, 2021 6:23 PM UTC

But this means that you’ll need nested properties for Variants. 🤯

I don’t think the UI of Figma is prepared for such an extension and neither the code behind. 🤔

Looking forward for something like this. 😁

Dave_Soderberg
New Member
Sep 22, 2021 12:05 AM UTC

Glad to see others requesting this! It would avoid those massive matrixes of every possible combination (even the ones you don’t want 🙂)

I can’t begin to imagine how difficult these things are with a massive user base and endless implications to consider.

But as an example, I could see:

  • Allowing nesting of sub-variants
  • Using a pick-whip like prototypes to visualize relationships
  • Visualizing the nested nature of sub-variants

e.g. in this example, the “Tertiary” button has only one content type

Guillaume_BRACHON
New Participant
Sep 10, 2022 5:54 PM UTC

I would love that too, it would be super useful!

Sep 30, 2022 6:30 PM UTC

this would be a good thing to have!

Aman_Goyal
Feb 9, 2023 10:43 AM UTC

Any progress in this feature? Can we do it now somehow? Please help.