Skip to main content
Question

Help to set an image value in variables?


lucasvieluz

I need set value for assets in my design system, ex:
My logo dark mode vs light mode, the brand asset are different for the color scheme.

The options available are:

  • Color
  • Number
  • String
  • Boolean

I try insert the URL from image value in string, but I dont have success to retrieve value and set for background.

Anyone have a idea to resolve this? 🤯

Anynone can help me?

11 replies

Mattias_Berkesten1

Just played with something similar. Tried to change the logotype of our multibrand design. In our header component i put both logotypes and controls them with booleans properties. Then I set the boolean values from two booleans variables.

Maybe not the best solutions since it will create more layers in the component?


Baffour
  • 53 replies
  • June 22, 2023

This wasn’t obvious from the UI but I discovered it in the Playground File.

You can bind a string variable to a variant property, which means if you have a component with each image as a variant, you can use a variable to switch between them


lucasvieluz

Tks for help!


lucasvieluz

I go try this, tnks 😉


Devon_Anderson1

I can’t get this to work. Do you have to name the modes the same as the variants?

For example type=


Daniele_Q
  • 14 replies
  • October 25, 2023

@lucasvieluz I’m probably stating the obvious here, but if you have an svg logo, you can assign color variables to the svg and they will switch in dark mode.

Of course, if you have a png, I feel your pain.

We desperately need a variable for assets, that will switch a graphic asset with modes.


Daniele_Q
  • 14 replies
  • October 25, 2023

Yes… variant are identified by names, and you can think of them as strings.


Zlatko
  • 37 replies
  • December 11, 2023

I think this feature should be coming soon, no?


Josh_Madrid

Running into this issue too i can build a complete complete that isnt bouncing around these things like styles, variables, tokens, & modes


Missy_Turco
  • New Member
  • 3 replies
  • January 17, 2025

I’m in need of this as well. I am working with several different partners and when demoing a design flow to them I want to make sure the demo includes their name and logo without having to manage a separate prototype for each of the partners as designs change. I am using modes to quickly switch between partner names which is great, but I can’t switch the logos using this same method which is a bummer.


Henk
  • New Member
  • 1 reply
  • March 25, 2025

This would be such a great feature. I was looking for it today and I can’t believe it’s not there.


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