Item variants like Amazon

How can I display item variants on item pages like Amazon instead of a configure button with dropdown boxes?

fetch all the variants under a template and create a button for every variants using a loop?

not sure, but i’d start in that direction to achieve something like this