Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

ROI Calculator Pricing Block for React

An ROI calculator for a workflow-automation tool: sliders for team size and hours saved a week feed one display-size figure, the net savings a month, with the value of the time, the seat cost and the return under it.

Framework
UI library

Preview

Preview width

Installation

Part of Pro
Pro unlocks the code and one-line install of every Pro button and text effect, plus the MCP for your AI editor.
Have Pro already? Sign in to open it.Opens here as soon as you're Pro.

Overview

Let buyers price the time your product gives back. Under a compact header row, one band between the page's rails holds the calculator. On one side, two Sliders set the team size and the hours each person saves a week, each with its value beside the label and its bounds under the track. On the other, the result: the net savings a month at display size, rolling with Sliding Number, with a return badge, the value of the time saved, the plan's cost, the yearly figure and the block's one primary Shine Button. The two assumptions (what a seat costs and what an hour is worth) sit in the header, so the maths is never hidden. On a phone the result button moves to a sticky bar with the live figure. Sliders use the theme's foreground colour so the call to action stays the only primary control. Built with Slider, Badge, Guides, Sliding Number, Shine Button and Lucide icons, with CSS transitions only. For automation, productivity and any tool sold on time saved.

FAQ

How do I change the prices, the hourly value and the ranges?

Edit the constants at the top of the file: SEAT_PRICE is the plan's price per member each month, HOURLY_COST what an hour of a team member's time is worth, and TEAM and HOURS set each slider's min, max and starting value. ASSUMPTIONS is the pair of facts shown in the header. The value of the time is members times hours a week times 52/12 weeks a month times the hourly value, rounded to a whole dollar before the rows are subtracted, so the rows always add up to the headline figure.

Are the sliders usable with a keyboard and a screen reader?

Yes. Each slider is named by its visible label and reads its value as words, "15 members" or "3 hours a week", rather than a bare number; the arrow keys, Home, End and Page Up and Down all work. A polite live region reads "Net savings $4,840 a month, 14.4 times what you pay" after a change, so the result is announced without moving focus.

How do I connect the button to a trial or checkout?

The button is a real link. It's a ShineButton with render set to an a element and nativeButton={false}. Add the chosen team size to the query, for example /signup?plan=team&seats=15, so the trial starts with the right number of seats. On a phone the same link lives in the sticky bar, and the one in the result panel is hidden below md.

What happens on a phone?

The sliders come first, then the result, and a sticky bar at the bottom of the section keeps the net savings and the button on screen while the sliders move. The bar sticks inside the section, so it leaves with it. Under md only one button is shown, so there are never two buttons to tab through.

Why are the sliders grey instead of the primary colour?

Each block spends the primary colour on one control. Here that is the call to action, so the sliders' track fill and thumb border use the foreground colour. They stay readable in every theme and in dark mode.

Are the savings figures real?

They are what the formula gives for the numbers on the sliders and the two assumptions shown in the header, nothing more. The example product, Relaywork, is fictional, so replace the prices and the hourly value with your own, and keep the assumptions visible: a calculator the buyer can check is one they trust.

  • Pro

    A receipt that prices itself, for a webhook-delivery service: number steppers for seats, events and days of history drive a live bill that stamps the cheapest plan and itemises what goes past its allowance.

  • Pro

    A seat calculator: a slider sets the team size with its count riding the thumb, ticks at the 10, 25 and 50 seat discounts, shortcuts to them, and a panel that rolls the seat price and monthly total.

  • Pro

    A total-cost-of-ownership projection for a data lake: a one, three or five year switch redraws a line chart of each option's cumulative cost, beside the two plans you can buy with their totals and buttons.

  • Pro

    A usage-based bill calculator for a search API: a slider over monthly search volumes sits in one short band, and a meter of what the plan covers and what is billed as overage rolls the estimated bill beside it.

  • Pro

    A split pricing section for a VPN with a contract length slider from 1 to 24 months in a card in a card, where the monthly price at display size, the discount, total and savings roll to each term, and a sticky bar on phones.

  • Pro

    An itemised monthly bill for an accounting suite: full-width ledger rows with quantities, a subtotal, the annual discount and the total, which a billing switch recalculates, beside the plan it adds up to.