Figma Support Forum

How do I “swap” icons in a component to create more variants?

Super new to Figma so apologies if this has been asked before or isn’t phrased properly.

I’ve created a component with 2 variants: selected and unselected.

I want to create a navigation bar for a mobile app that has different icons for each option - e.g. Home, Popular, Hottest, TV Shows (see bottom). The house icon I’ve used here is from a plugin.

Is there any way for me to “replace” each icon easily? Or do I have to detach, delete,and add new icons manually for each new variant?

I’m also not sure how to centre long text underneath each variant, I’m guessing I have to detach it?

1 Like

Use regular instance swapping for icons: Figma Tutorial: Components - Swapping and States - YouTube

1 Like

To elaborate on Gleb’s answer, you first would need to make the individual icons into components in your Figma file. Then you need to use instances of those icons to build your bigger components. If your Nav Icons component is made of those instances, and your Nav Bar component is made of them as well, you will be able to select the icon instances and swap them out using instance swapping in the right-hand panel.

So, it seems you’re missing the bottom level of components—the icons themselves. Once you have those built everything will fall into place for you.

You have a few options for centering the text. You can use auto-layout to do that or just select center alignment on the text itself and position the text in the middle of the frame, with center constraints set on it so it resizes properly.


Thanks Brian!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.