Last updated
Was this helpful?
Last updated
Was this helpful?
Boolean Tokens define layer visibility of an element as true or false.
It does not control component properties, as Figma doesn't allow it.
Boolean Tokens are great for hiding or showing layers that may be visible within a component under certain conditions.
For example, a card with some actions that are only visible once the card has been interacted with.
You could create two Boolean Tokens:
card.show-actions.default
with a value as false
.
card.show-actions.interaction
with values as true
.
Then, apply the Boolean Tokens to the Actions layer of each variation of the card design.
The syntax used to write string values for Design Tokens is important, so be sure to write your Boolean Token value with all lowercase letters and ensure there are no spaces.
There are only two possible values for the Boolean Token:
true
The layer is visible.
false
The layer is not visible.
When trying to reference another Token as the Value for a Boolean Token, you will see Tokens in the dropdown list that are:
Living in Token Sets that are currently active.
In the left menu on the plugin's Tokens page, a checkmark is visible next to the Token Set name.
Token Type is compatible:
The same = boolean
You can apply a Boolean Token to show or hide any design element and all of its children layers.
With one or more elements selected in Figma, click on the name of your chosen Boolean Token in the Plugin to instantly apply its value.
boolean
is not yet an official Token Type in the W3C DTCG specifications. Tokens Studio has added Boolean as a Token Type to support Figma's Boolean Variable.
When transforming Boolean Tokens, there are no specific configurations to be aware of.
Running the SD-Transforms pre-processor as part of the generic package will prep your Boolean Tokens for Style Dictionary.
Mentioned in this doc:
None yet!
None yet
→
SD-Transforms -
Style Dictionary -
Design Tokens Community Group -
Design in Figma -
MDN Web Docs -
Tokens Studio Plugin GitHub -
Once a Token has been applied, it will remain attached until you manually remove it.
Engineers typically transform Tokens used in code with , which is tool-agnostic. Tokens coming from Tokens Studio require an additional step: , an npm package that prepares Tokens for Style Dictionary.
💡 Something to share?
🐞 If you are experiencing an issue not listed here, please reach out to us on the Troubleshooting channel of our , , or send us an email support@tokens.studio
💌 Visit to contribute or subscribe to updates.
However, like all Token Types, you can "force" a reference by manually entering the Token Name between curly brackets.
For example {token.name.here}
Jump to the guide on Token Values with References by selecting the card below to learn more.