Skip to content

[pricing] feat: add dynamic savings badge on yearly toggle#7800

Closed
akshatsinghai6682-sketch wants to merge 2 commits into
layer5io:masterfrom
akshatsinghai6682-sketch:feat/pricing-yearly-savings-badge
Closed

[pricing] feat: add dynamic savings badge on yearly toggle#7800
akshatsinghai6682-sketch wants to merge 2 commits into
layer5io:masterfrom
akshatsinghai6682-sketch:feat/pricing-yearly-savings-badge

Conversation

@akshatsinghai6682-sketch

@akshatsinghai6682-sketch akshatsinghai6682-sketch commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Description
This PR fixes #7799

Added a dynamic "Save X%" badge on the Yearly toggle button in the pricing page.
The badge appears when Yearly is selected and dynamically calculates the maximum
savings percentage from the plan data, so it always reflects accurate savings.

Changes

  • Added getMaxSavingsPercent() function to dynamically calculate max savings from plan data
  • Added savings badge that appears on the Yearly toggle button when selected
  • Badge shows "Save 15%" (or whatever the actual max savings is)
  • Styled with green background (#00D3A9) matching Layer5 brand colors
  • No changes to existing pricing logic or styling

Screenshots

Image 17-06-26 at 12 06 PM

Notes for Reviewers
The badge is only visible when Yearly is active. The savings percentage is calculated
dynamically from options plan data — not hardcoded — so it will automatically
update if plan prices change.

Signed commits

  • Yes, I signed my commits.

@github-actions

github-actions Bot commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Preview deployment for PR #7800 removed.

This PR preview was automatically pruned because we keep only the 6 most recently updated previews on GitHub Pages to stay within deployment size limits.

If needed, push a new commit to this PR to generate a fresh preview.

@NSTKrishna

NSTKrishna commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

@akshatsinghai6682-sketch also can you match the border color like white to ensure the consistency
Screenshot 2026-06-16 at 4 57 42 PM

@akshatsinghai6682-sketch

Copy link
Copy Markdown
Contributor Author

@NSTKrishna Added white border to the savings badge for consistency. Please take a look!

@NSTKrishna

Copy link
Copy Markdown
Contributor

@NSTKrishna Added white border to the savings badge for consistency. Please take a look!

also i suggest one more thing to do default color of monthly and yearly should be white because there is not black text in the whole page it look off

@akshatsinghai6682-sketch

Copy link
Copy Markdown
Contributor Author

@NSTKrishna Updated the default text color of Monthly and Yearly to white for consistency. Please take a look!

@NSTKrishna

Copy link
Copy Markdown
Contributor

@akshatsinghai6682-sketch also can you match the border color like white to ensure the consistency Screenshot 2026-06-16 at 4 57 42 PM

bordercolor is not working check it again

@akshatsinghai6682-sketch

akshatsinghai6682-sketch commented Jun 16, 2026

Copy link
Copy Markdown
Contributor Author

@akshatsinghai6682-sketch also can you match the border color like white to ensure the consistency Screenshot 2026-06-16 at 4 57 42 PM

bordercolor is not working check it again

Image 16-06-26 at 5 47 PM 2 in mine it is showing i have checked the preview actually tell me if some problem is still coming

@NSTKrishna

NSTKrishna commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

i was say to add the border color monthly , yearly div currently it is blue

@akshatsinghai6682-sketch

Copy link
Copy Markdown
Contributor Author

i was say to add the border color monthly , yearly div currently it is blue

ok i will add it and that border of the save 15% badge is it looking good according to website?

@akshatsinghai6682-sketch

Copy link
Copy Markdown
Contributor Author

@NSTKrishna there is a network issue here i could submit you updated pr by 10:30 for sure thanks for the feedback

@chaitanyamedidar chaitanyamedidar left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@akshatsinghai6682-sketch , was this issue/approach discussed with any member? As this issue hasn't been assigned yet, thus not validated.
I have few follow ups, your acceptance criteria mentions "Badge disappears or changes when Monthly toggle is selected". On the contrary, showing savings awareness on the Monthly toggle too could help users decide earlier. Thoughts?

Comment thread src/sections/Pricing/index.js
@akshatsinghai6682-sketch

Copy link
Copy Markdown
Contributor Author

@chaitanyamedidar i will surely do the change and submit by new pr its still not discussed i guess i will discuss it in next monday website meeting thanks for the feedback

@chaitanyamedidar

Copy link
Copy Markdown
Member

@akshatsinghai6682-sketch You could bring it up on the thread where you've mentioned this PR.

@akshatsinghai6682-sketch

Copy link
Copy Markdown
Contributor Author

@akshatsinghai6682-sketch You could bring it up on the thread where you've mentioned this PR.

I have shared link of this in slack and asked for review

@akshatsinghai6682-sketch

Copy link
Copy Markdown
Contributor Author

"@chaitanyamedidar I have addressed your feedback:

  1. Changed badge text to 'Save Upto 15%' to clearly indicate maximum savings

  2. Badge now always shows on Yearly button to encourage users to switch"

@akshatsinghai6682-sketch

Copy link
Copy Markdown
Contributor Author

i was say to add the border color monthly , yearly div currently it is blue

Addressed the feedback please review it thank you

@saurabhraghuvanshii

Copy link
Copy Markdown
Member

@akshatsinghai6682-sketch, why do we need this? I still don't fully understand the use case. Could you please bring this up during Monday's meeting so we can discuss it in more detail?

@akshatsinghai6682-sketch

akshatsinghai6682-sketch commented Jun 18, 2026

Copy link
Copy Markdown
Contributor Author

@saurabhraghuvanshii Sure! I'll bring this up in Monday's meeting.

Quick context: Currently when users switch to Yearly billing,
there's no indicator showing how much they save compared to
Monthly. This badge helps users quickly see the value of
choosing yearly billing, similar to how GitHub, Notion, and
Linear show "Save X%" badges on their pricing pages to
encourage annual subscriptions.

Happy to discuss further on the call!

@Bhumikagarggg

Copy link
Copy Markdown
Contributor

@akshatsinghai6682-sketch Thank you for your contribution! Let's discuss this during the website call tomorrow at 5:30 PM IST | 7 AM CST Add it as an agenda item to the meeting minutes, if you would 🙂

@akshatsinghai6682-sketch

Copy link
Copy Markdown
Contributor Author

sure @Bhumikagarggg

@akshatsinghai6682-sketch

akshatsinghai6682-sketch commented Jun 22, 2026

Copy link
Copy Markdown
Contributor Author

Had technical issues during today's meeting and couldn't
share my screen. I've addressed all review comments:

  1. ✅ Changed to "Save Upto 15%"
  2. ✅ Added white border for consistency
  3. ✅ Toggle text always white
    4.Issue is assigned now
    @chaitanyamedidar

@Sbragul26

Copy link
Copy Markdown
Member

On initial load, the currency dropdown text is overlapping and looks broken. Could you please fix this issue?
image

@akshatsinghai6682-sketch

Copy link
Copy Markdown
Contributor Author

sure @Sbragul26

@akshatsinghai6682-sketch

akshatsinghai6682-sketch commented Jun 22, 2026

Copy link
Copy Markdown
Contributor Author

"Hi @Sbragul26! I've fixed the currency dropdown overlap issue. Please see before/after screenshots above — the dropdown now displays cleanly without any text overlap. The Save Upto 15% badge is also working correctly! "

Screenshot 2026-06-23 at 3 35 12 PM

now there is no loading problem thanks for the feedback please review this whenever possible

@akshatsinghai6682-sketch

Copy link
Copy Markdown
Contributor Author

On initial load, the currency dropdown text is overlapping and looks broken. Could you please fix this issue? image

i have fixed the issue but should i open another pr for this issue or in this only it would merge?

@Bhumikagarggg

Copy link
Copy Markdown
Contributor

On initial load, the currency dropdown text is overlapping and looks broken. Could you please fix this issue? image

i have fixed the issue but should i open another pr for this issue or in this only it would merge?

Open a new pr

@akshatsinghai6682-sketch

akshatsinghai6682-sketch commented Jun 24, 2026

Copy link
Copy Markdown
Contributor Author

On initial load, the currency dropdown text is overlapping and looks broken. Could you please fix this issue? image

i have fixed the issue but should i open another pr for this issue or in this only it would merge?

Open a new pr

actually @Sbragul26 so he was telling to update in same pr

@Bhumikagarggg Bhumikagarggg left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@akshatsinghai6682-sketch Thanks for the contribution. I approve this PR. Just one request: please squash the 14 commits into a single commit before merging.

@akshatsinghai6682-sketch

Copy link
Copy Markdown
Contributor Author

Ok @Bhumikagarggg

@rishiraj38 rishiraj38 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This branch appears to have picked up some unrelated commits. Could you please clean it up so that only the intended changes remain?

@akshatsinghai6682-sketch akshatsinghai6682-sketch force-pushed the feat/pricing-yearly-savings-badge branch 2 times, most recently from b609d1a to 3ec4ff1 Compare June 24, 2026 14:08
Signed-off-by: Akshat Singhai <akshatsinghai6682@gmail.com>
@akshatsinghai6682-sketch akshatsinghai6682-sketch force-pushed the feat/pricing-yearly-savings-badge branch from 217ba2c to 5b4d596 Compare June 24, 2026 14:12
@akshatsinghai6682-sketch

Copy link
Copy Markdown
Contributor Author

@Bhumikagarggg Done, I've cleaned up the branch and squashed the changes into a single commit. The branch has been force-pushed with only the intended pricing badge changes. Thanks for the review and approval!

@akshatsinghai6682-sketch

Copy link
Copy Markdown
Contributor Author

This branch appears to have picked up some unrelated commits. Could you please clean it up so that only the intended changes remain?

I've cleaned up the branch and removed the unrelated commits. The PR now contains only the intended pricing badge changes in a single commit. Could you please take another look?

@saurabhraghuvanshii

Copy link
Copy Markdown
Member

Thanks, @akshatsinghai6682-sketch. We don't need this for now, but I appreciate the time and effort you've put into it.

Thank you for your contribution and willingness to help. It's greatly appreciated!

@akshatsinghai6682-sketch

Copy link
Copy Markdown
Contributor Author

ok @saurabhraghuvanshii thank you

@akshatsinghai6682-sketch akshatsinghai6682-sketch deleted the feat/pricing-yearly-savings-badge branch June 24, 2026 19:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Show yearly savings badge on pricing page toggle

7 participants