Skip to main content
July 11, 2023

Invert boolean variable for layer display

  • July 11, 2023
  • 45 replies
  • 9502 views

Right now, tying layer visibility to a variable means if the boolean is false = layer is hidden. It’d be great if we could invert this functionality (boolean is false = layer is shown) on a per-layer basis as I need to show some layers and hide others depending on the state of the variable.

Anyone else run into this?

45 replies

maria51
New Member
December 18, 2024

Being able to set the Value of Var z depending equal to !Y in Local Variables would already solve this:
so lets say I have a boolean “Show Edit Dialog” and now I want to link the variable “Forbid change” (applied in another comp) to it, so that whenever Show Edit Dialog is true, Changing some other component is forbidden.

Or do I oversee something and this is already possible?

Thank You!

Thank you!

fab4minds
New Member
January 22, 2025

I also use always 2 variables and when I change the value of variable1 I also update “variable2 = not variable1” and vice versa. The 2 variables are not the problem, but always keeping both in sync is very annoying. In the variables panel you can set “variable1 = variable2”, it would be nice if figma would just allow boolean operators in there, so you can set any combination of other boolean variables (e.g. NOT variable1 AND variable3 OR variable 2) as value of another variable.

Direct_Access
New Participant
February 19, 2025

Why this feature is desired?

I also encountered this “problem” in Figma. Mainly this feature is required because there are plenty of common situations that would benefit from it. For instance if you create a basic todo-app-ui then a todo is “done” or “not done” for which you likely have two visual appearances that depend on one variable. Sure, there are workarounds, but the workarounds have a lot of downsides, so implementation of the requested feature (show when x is false and hide when x is true) is very much desired.

 

Why two variables for each boolean don't scale

There is the workaround with having a “active” and “inactive” boolean variable. This however does not scale well because:

  • You have to add to variables for one boolean while.. booleans have two states you could benefit from
  • You have to change both variables everytime the situation changes
  • Your list of variables is twice as long and thus finding the right variable is more difficult
  • Your list of variables is twice as long and thus keeping overview over it is mentally harder

 

Why component-variants don't scale

There is the workaround of creating component-variants for the true and false state. That however isn't maintainable either. If there are more variables at play you get a multitude of component variants. For instance if you have 5 booleans, you'd have 2^5 = 32 variants to possibly maintain.

KellyK
Active Member
April 1, 2025

+1, every time I need to build error messages in a prototype, I need an inverse boolean. e.g. if something is false, show the error layer.

Adam Slíva
New Member
April 7, 2025

+1, I’m confused that this isn’t a thing already, as it seems so elementary to me.

Dennis_Harz
New Member
April 11, 2025

 

Oliver_Rothenhausler1
New Participant
July 28, 2025

+1, I’m confused that this isn’t a thing already, as it seems so elementary to me.

Well, only 25 votes. 

Jay Bee
New Participant
August 7, 2025

Will this ever be implemented? It seems like such a tiny addition with a lot of potential.

Dirk_Schiller1
New Member
August 9, 2025

+1, I’m confused that this isn’t a thing already, as it seems so elementary to me.

Well, only 25 votes. 

Well, only 7230 views.

A request like “Invert boolean variable for layer display” getting 7,230 views in 2 years means thousands of people have run into the same issue. You don’t search for and click something that specific unless you’re facing it yourself.

Votes show explicit support, but views show recurring need - and in cases like this, the audience is already self-filtered. Ignoring views risks missing the real scale of the problem just because many readers didn’t (or couldn’t) vote.

Sofie_Katan1
New Participant
October 22, 2025

I couldn’t agree more, also there are several feature requests asking for this..so votes and views for all of them should be considered