Skip to main content
Solved

Best way of prototyping a highlight on an item in a list?

  • September 19, 2024
  • 5 replies
  • 209 views

Jen13

Hi there,

I’m sure this comes up a lot but I wondered what the best way of highlighting one item in a list of items is on click? I know I can change component variant on click but this won’t change the others back. Here’s what I need:

List of Items - Default Not Highlighted
Click on item - Highlight Item
Click on different item - Highlight this item but UNHIGHLIGHT other item

What is the best way of doing this?

This is the only way I can do it at present which is laborious and requires a new component for every version of the list. Seems like an inefficient way to do it!

Thanks
Jen

Best answer by Pavel_Kiselev

Well, it seems you can make it a bit easier with variables

This is how I did it. Firstly you would need a list component where each variant contains only one selected item

Then you create a variable to bound to the selected property of your list

Lastly, you make each list item to set a variable value. I use the multi-edit feature so I don’t have to touch every single list item in every variant I made

And now I have one

View original
This topic has been closed for replies.

5 replies

Pavel_Kiselev
  • Power Member
  • 438 replies
  • Answer
  • September 20, 2024

Well, it seems you can make it a bit easier with variables

This is how I did it. Firstly you would need a list component where each variant contains only one selected item

Then you create a variable to bound to the selected property of your list

Lastly, you make each list item to set a variable value. I use the multi-edit feature so I don’t have to touch every single list item in every variant I made

And now I have one


Pavel_Kiselev
  • Power Member
  • 438 replies
  • September 20, 2024

But for a list of 13 items you need to have 13 variants, still a big ouch


Jen13
  • Author
  • 4 replies
  • September 20, 2024

Thank you for that I thought something like that would be possible! I’ll give that a go.


Jen13
  • Author
  • 4 replies
  • September 20, 2024

This worked thanks! Thanks for mentioning multi-edit, hadn’t realised this was possible so that’s a life saver!


Pavel_Kiselev
  • Power Member
  • 438 replies
  • September 20, 2024

Glad it helped, cheers


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