Skip to main content
Question

Bolean for fills or colorstyles in a component

  • August 4, 2023
  • 1 reply
  • 210 views

Micha

Hello,

I want to switch the background of all variants in a component (BG= multiple colors or background style) on or off.
With Variants (Fill = true or false) this is not possible.
Is that only possible via an instance swap?

Thanks a lot

This topic has been closed for replies.

Saulo_Vallory

I think the “cascading components” style combined with exposing properties may help. Basically, you create a component only for the background and use it every variant. When you change the fill of your background component, all variants will be updated (as long as you have not overridden the fill of the background component in a variant)

A similar approach is used in this file: https://www.figma.com/community/file/1263241930808853140/Component-Variance-Authority-(CVA)-Playground


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings