Figma Support Forum

Is there a way to variant properties dependent on each other?

I’ve got a header element I reuse all over the place. I use it for bills, claims, etc. There are all sorts of rules around how many lines you show, etc. I started to set these up as variants, but some properties only apply to one type, i.e. past due only apply to bills. So if I toggle the type to claims, I still have an option for past due, which doesn’t make sense.

I can set up multiple components or rejigger my variants, but before I do that…is there a way to say “only show these property options if x is selected”?

Unfortunately, there’s no way to do that. If your variants don’t form a perfect grid, there’s no way of knowing when you select a property from the dropdown if the combination your choosing is valid. To avoid confusion, I’d split up your variants.

Fair enough! There didn’t seem to be but I thought I’d ask. I did discover I could nest a component with variants inside a component with variants, which is almost what I was thinking, minus the need to know you need to click a level deeper to see the nested options.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.