Skip to content
tezvyn:
Menu

Boolean Component Properties in Figma

MediumHow cards are made

Boolean properties in Figma are light switches for layers inside a component. They let you toggle an icon or badge on and off without spawning extra variants. The catch is that hiding a layer can break auto-layout if that layer was anchoring spacing.

Why it exists

Before component properties existed, Figma designers managed optional elements by creating separate variants for every combination. A simple button with an optional icon required two variants, and the matrix grew exponentially as more options were added. Boolean properties were introduced to collapse these binary visibility choices into a single toggle, shrinking variant trees and making components easier to maintain.

The mental model

Think of a boolean property as a light switch wired to a specific layer inside your component. Instead of building two rooms that are identical except for one lamp, you install one switch. When the switch is on, the lamp is visible. When it is off, the lamp is hidden. The room itself does not change.

How it works

You select a layer nested inside a main component and create a boolean property, giving it a clear name like Show Icon or Has Badge. Figma exposes a toggle in the right sidebar when an instance is selected. Setting the toggle to true keeps the layer visible, while false hides it. The layer remains in the component's layer tree; only its visibility changes per instance. This works best when the layer is a self-contained element that does not hold together the surrounding auto-layout frame.

When to use it

Use boolean properties for any binary visibility decision that does not require a different component structure. Common cases include showing a notification dot on an avatar, displaying a helper text block under an input field, adding a trailing icon to a button, or revealing a close button in a modal header. If the only difference between two states is whether something appears, a boolean property is the right tool.

When not to use it

Avoid boolean properties when hiding the layer would break the layout because the layer was acting as a structural spacer or auto-layout padding element. Do not use them when you need to swap the hidden element for a different one, since boolean properties only control visibility and cannot change the underlying node. If the component needs different styling, sizing, or behavior when the element is absent, a dedicated variant is usually safer.

One canonical example

Consider a button component that can optionally display a star icon. Instead of maintaining Button Default and Button With Icon as separate variants, you build one Button component with an icon layer inside and add a boolean property named Show Icon. A designer placing the instance simply flips the toggle to show or hide the star. If you later need to swap the star for a heart, you can pair the boolean with an instance swap property on the same layer, keeping the component surface small and the system scalable.

Interview question

What is the main risk of toggling off a boolean property on a layer that sits inside an auto-layout frame?

  • a.The auto-layout spacing may break if the layer was anchoring structural spaceCorrect
  • b.The toggle will be hidden from other designers in the right sidebar
  • c.The component will automatically spawn a variant to preserve the layout
  • d.The layer will be permanently deleted from the main component
Why?

The card warns that hiding a layer can break auto-layout when that layer acts as a structural spacer or padding element. Distractor A confuses hiding with deletion; the layer remains in the tree but is simply invisible.

Just read this? Test yourself on what you have been reading.

Put your scrolling time to good use

Learn one idea, try a quiz and save useful cards for revision. Tezvyn makes it easy to learn and stay current in your tech field, a few minutes at a time.

The iPhone app is on the way

We are building it. Until it lands, nothing here is held back from you: every interview card, your saved cards, streaks and the job board all work in Safari, plus hundreds of free practice quizzes of thirty questions each. Sign in and it all carries over to the app the day it arrives.

Want it as an icon? Tap Share at the bottom of Safari, then Add to Home Screen. It opens full screen and the cards you have read stay available offline.

Get it on Google PlayiPhone app coming soon

We are hiring for this. Open roles that interview on figma — each one lists the topics its interview covers.

See open roles