Skip to main content
Solved

Should I use variants for this or no?

  • September 15, 2023
  • 1 reply
  • 219 views

Shani_S

Hey!
I’m trying to better understand variants and make my life much easier, but I’m unsure if I am doing the right thing!

What I basically want: I have a frame that has a State field, once the user clicks on it, a menu will move in the same frame from the bottom.

What I did: I made the field as a component, same for the menu but also made it as a variant. I added the button inside the same variant grouping and I am trying to connect all of them together to make this happen but it does not happen.

Can someone explain why or what is the best way to do it?

Thanks!

Best answer by SohrabNiroo

Hi there @Shani_S

I don’t think you’re using it correctly.
Variants are there to make your component logic comprehensive, not your frame logic

Make each element separate components (use variant components with the use component properties if your elements have different states) then create a frame and reuse those components and connect their child together.

This is a good tutorial to fully understand variants: https://www.youtube.com/watch?v=sU-xp2V7-_A

View original
This topic has been closed for comments

1 reply

SohrabNiroo
  • New Participant
  • 188 replies
  • Answer
  • September 16, 2023

Hi there @Shani_S

I don’t think you’re using it correctly.
Variants are there to make your component logic comprehensive, not your frame logic

Make each element separate components (use variant components with the use component properties if your elements have different states) then create a frame and reuse those components and connect their child together.

This is a good tutorial to fully understand variants: https://www.youtube.com/watch?v=sU-xp2V7-_A


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