Skip to main content
Ilya_Ivanov
July 20, 2023

LAUNCHED: Apply negated boolean variable (to the layer visibility)

  • July 20, 2023
  • 9 replies
  • 2745 views

Sometimes a particular boolean variable can affect several layers. And some of that layers may require inverted visibility state. E.g. Layer 1 is visible when the variable is truthy and Layer 2 is visible when the same varaible is falsy.

Let’s say, we have a multiselect field with a dropdown. When we select the first option, it should be added into the input as a label (label layer becomes visible). But also this option should be removed from the dropdown list as it’s no longer availiable for selection (option layer becomes hidden). So, both states depend on the same variable, but their conditions are inverted.

It would be nice to have some negation operator when applying a varaible. Kinda logical not (!) in JS: ! isSelected. Or just allow us to apply boolean expressions as we do in prototypes , e.g. isSelected != true.

9 replies

July 20, 2023

Agreed, I was surprised that the variable logic wasn’t able to conditionally display an element if the value was false. This is something you see all the time in front-end code.

Stefan_Gv
July 21, 2023

Figma team should make all the fields bindable to a variable. The visibility (on/off boolean) one is a no brainer to me. I’ve already had a couple of prototypes where I wanted to do that exact behavior.

August 31, 2023

I wanna toggle visibility of layer 1 with a boolean property, and then layer 2 should be toggled with negation of the same property.

For example, I have a block with 2 sub-blocks. Sub-block 1 should be visible if a boolean property “Market open?” is set to true, and sub-block 2 should be hidden in this case. When I toggle the property, visibility of the blocks should swap.

Of course, I can create 2 variants: one with sub-block 1 only, and another with sub-block 2 only. But they share the same design of all the other sub-blocks, and I wouldn’t like to have 2 sources of truth

image

November 29, 2023

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

Celine_
Figmate
Community Support
February 28, 2024

Hey everyone!

We are pleased to announce that with the launch of some new Figma Prototyping updates, you can now negate a boolean: a user can now use “!” or “not” in a boolean conditional check, rather than check “true” or “false”. Learn more in our article here.

harsha20599
New Participant
February 18, 2025

Hey everyone!

We are pleased to announce that with the launch of some new Figma Prototyping updates, you can now negate a boolean: a user can now use “!” or “not” in a boolean conditional check, rather than check “true” or “false”. Learn more in our article here.

Hey, I think the update is not related to this request. 

This is talking about impacting two different layers with same time with same boolean variable. But one works inversely. 

The update is dynamically changing the variables in runtime in the prototype mode.
 

Robot
June 30, 2025

Bump

Adam Ascroft
New Member
March 23, 2026

Would love this! A single boolean like TaxAvailable should be able to show Section A when true and show Section B when false without needing a second redundant variable.\

 

I know you can do this with prototyping but that’s not where I want this.

fernando.santos-nuuv
New Participant
June 8, 2026

Hey everyone!

We are pleased to announce that with the launch of some new Figma Prototyping updates, you can now negate a boolean: a user can now use “!” or “not” in a boolean conditional check, rather than check “true” or “false”. Learn more in our article here.

This is not what we are asking for, this only works in runtime in the prototype. We need this as part of property definition in a component.