Skip to main content

Sort variants alphabetically (ascending/descending)

  • April 21, 2021
  • 49 replies
  • 15798 views

Show first post

49 replies

Facem_Graphics

Anyone else missing the powerful sorting from the old variants panel?
Sorting values in the new variant property panel is an irritating pain compared to this and takes forever. Was hoping that it will get noticed and fixed/reverted by now, but hey.
Such productivity!


Sam_Tamiosso

hi guys!!

any news?


Natti
  • New Participant
  • August 19, 2022

Running into this frequently and honestly all they’d have to do is make the order match the variant order that’s already in the component.
Screen Shot 2022-08-19 at 3.23.11 PM

There are plenty of plugins to auto sort layers but for whatever reason the variant menu is different, requiring a manual reorder.

Screen Shot 2022-08-19 at 3.23.03 PM

Screen Shot 2022-08-19 at 3.23.42 PM

Which is mostly fine for smaller components but annoying to say the least to have to do every time and not feasible for larger more complex variant sets.

I also don’t count breaking the component to get it resorted as a “solution” since I’d literally have to re link all of the instances.


Timothy_Sullivan

I’ve tried this and it does not work unfortunately.


Hoang_Anh_Le

I’ve created a plugin to search variant by name.
Yet, the plugin is under reviewing by Figma team and I hope it will be approved to publish soon
Screen record of the plugin


So we are still waiting for a solution to this? I have to add new icons and it is a mess, unless I do it manually which is time consuming. 😦


S_e_b_a_s_t_i_a_n

I’m desperate. I need this feature!


Pavel_Kiselev

The worst way to make flags mate


S_e_b_a_s_t_i_a_n

Ok, do you have a better idea?


Pavel_Kiselev

I’d make each one of them as a single component. This way my users will be able to lookup an asset they need. And this is the best practice from Figma itself, fairly obvious though 🤣


S_e_b_a_s_t_i_a_n

The problem with single components here is, to hold additional meta data like in my case, ISO codes. So far there is no reasonable solution for this in Figma.

My current solution for it looks like this:

image
I’m not happy with that.


Stephane_Popout

I think I found the hack 🙂

If you rename a variant field two times in a row, the values are reordered.
It worked on figma desktop on my mac (did not check into the browser)

@S_e_b_a_s_t_i_a_n @Rebekka_Karrengarn you just need to rename Country into Country2 and then name it back to Country

Normaly this is safe and should not break anything too, right @Ilya_Ivanov ?


Andres11
  • May 19, 2023

It works Stephane, you are a genius! thanks.


Stephane_Popout

You’re welcome 💪🏽


@Stephane_Popout
This doesn’t work for me, can you upload some images or a gif to show how you do it?
Thanks


Stephane_Popout

here a gif below
At the beginning the variant “aaa” is at the end
After changing 3 times the variant name → “aaa” is back at the top

Remarks:

  • You really have to change it in a row (2 or 3 times if it did not work)
  • The sorting is case sensitive → this is why Default stayed first before “aaa”
    • So have a lowercase or uppercase for all your variants name

Order variants alphabetically


Hi guys,
I wanted to let you know that I created a plugin that works with the solution @Stephane_Popout suggested. I hope it can help you!

Figma

Rebekka_Karrengarn

genius work-around


Ryan_Brodie

This is the answer! ❤️

Thank you thank you thank you


Mikel_Rosenthal

YES!!! I just selected all the instances. Renamed them all to have “_2” at the end. Then named them back by removing the “_2” and BOOM. Instances show up in alphabetical order now. I did use SortIt Plug to do the main organization first so they viewed in order in your library as well. THANK YOU STEPHANE! It took me seconds to fix this with this work around.


Stephane_Popout

Happy to know it worked 🎉


Stephane_Popout

Well done Mikel 🤗🎉


Michal_Seps

Holy crapmoly this is genius. Nice!


Eli_Fares
  • New Member
  • April 24, 2025

+1
Having a large list of variants in one component is pain to click and drag the order. Would love it if we can auto-sort them in ascending alphabetical order.