Creating toggle buttons that change on page content

Hi all, i’ve tried searching for this but I wasn’t able to find posts specific to this scenario.
I’m designing a pricing page that offers monthly or annual pricing for each plan. I want to create a toggle between those (so that users are only shown annual pricing unless the press the monthly button)

I’ve put a screen shot of my design below. Right now, you can see that “annual” is selected, and annual pricing is shown just under it. I’d like for users to be able to select monthly (and have the colors flip on BOTH buttons to reflect which is selected–i suspect i’ll need to make those components with variants for this to work) and then ALSO have the text underneath change to reflect the monthly pricing. Should the entire thing be one component? Do i need to just design multiple pages and prototype between them?

The fun (and at times stressful) thing about Figma is you can solve things in so many different ways.

So you could use:

  • Variables
  • Multiple pages
  • Component with variants

Initially I lean to using a component with variants.
For example you’d create a component with 2 variants. One variant has your two buttons and the annual text, and the other variant has the button toggled and monthly text. Then prototype it so that when one clicks the buttons you change between those 2 variants.

1 Like

@Nate_G is spot on; there are many ways to peel this potato! Which method you go with ultimately boils down to:

  1. What ways are you most comfortable working?
  2. How much time do you have right now?
  3. How much longer/more do you anticipate designing in this file?

Variables would be best if any of the following are true:

  • you need to reference the user’s selection further down in the prototype journey. For example, a checkout screen with a purchase summary that reflects either “annual” or “monthly.”
  • selecting “annual” or “monthly” changes the prototype journey, kind of like a flow chart. For example, maybe users who select monthly see more upsells for other products or packages on their way to the final checkout screen?

If you’re trying to create a more sophisticated prototype, want some practice using variables, or have more work ahead of you in this file, then going the route of variables seems like a good investment.

Making each screen into a variant inside a component set would be best if any of the following are true:

  • you’re already using components for most if not all elements on each screen
  • the design of this screen is close to final, but could change

This is a good way to go to get the interaction sorted out without needing to worry about potential future edits. The “select matching layers” functionality could help you make bulk adjustments across each and ensure accuracy as you do so.

Multiple screens would be best if any of the following are true:

  • you’re confident you won’t be working in this file much longer, you’re at the end of some project and this is just a small edit you need to make
  • you’re already using components for most if not all elements on each screen
  • the design of this screen is finalized, and won’t be changing

I recommend this if you’re nearing the end of the project and don’t anticipate working in the file much longer only because this is sort of the “quick and dirty” way of working now that we have features like variants and variables. This set up can be frustrating to deal with down if future edits are needed.

1 Like