shadcn.io is not affiliated with official shadcn/ui
Centered ROI Calculator Hero Block for React
A centered showcase hero with two actions over a framed calculator: a team-size slider beside an estimate of the annual savings, which rolls to each new figure.
Installation
Overview
A centered hero whose hook is a number the visitor works out for themselves, for React with Base UI, shown here for Clearline, a support-desk tool. An announcement pill links to the ROI report, then a two-line headline, a promise and two actions, the filled Shine Button and an outline Button, all within the first screen. Below them the calculator sits in a hairline frame with + marks on its corners, split in two by a divider. On one side a Team size slider runs from 5 to 100+ seats, with a note on how the saving is counted; on the other a large estimate of the annual savings whose digits roll to each new figure as the slider moves, over the working: seats times the saving per seat, plus the flat saving from answering repeat tickets. Built with Announcement, Badge, Slider, Sliding Number, Guides, Shine Button and Button, with Lucide icons, Tailwind CSS and CSS motion that stays still under reduced motion. For B2B savings calculators, ROI estimators and any landing page where the value scales with the customer's size.
FAQ
How do I change the savings formula?
savingsFor turns a team size into the yearly savings: each seat saves PER_SEAT_SAVING, plus a flat AUTOMATION_BONUS. Replace it with your own model, such as hours saved times an hourly rate, or a table of tiers; the figure, the working beneath it, the announcement and anything you send on all come from it, so change the note on the left and the two rows of the working to match. MIN_SEATS and MAX_SEATS bound the slider, CURRENCY is the sign shown before the figure, and the team size starts at 25.
Why does the top of the range read 100+?
The slider's last step stands for any larger team: seatsText writes it as 100+ seats, both beside the slider and in what screen readers hear, and the estimate there is the one for 100 seats. Bigger teams usually talk to sales, which is the second call to action. Raise MAX_SEATS to cover larger teams on the slider itself.
What do screen readers hear?
The slider is labelled Team size and reads its value as seats, such as 25 seats, rather than a bare number: getAriaValueText receives the formatted value, the number and the thumb's index. The savings figure keeps its full value in visually hidden text, so its rolling digits are never read. Once a drag or a key press ends, a polite live region says the new estimate, such as $26,250 estimated annual savings for 25 seats; nothing is announced on load or on every step of a drag.
How does the figure roll, and what happens with reduced motion?
The figure is a SlidingNumber: when the estimate changes, only the digits that changed roll to their new value, in 400 milliseconds, with CSS transitions. The page loads with the real estimate already written, so nothing counts up from zero. With reduced motion the digits change in place, and the hero skips its entrance. The slider's fill and thumb are drawn in the foreground tone, so the Shine Button stays the one primary control.
How do I send the team size on to sign-up or sales?
Put it in the links' href, such as /signup?seats=40, from the seats state, so the next page can start from the visitor's own number. To learn which sizes visitors settle on, send an analytics event from the same callback that sets the announcement, onValueCommitted, which fires once when a drag or a key press ends rather than on every step.
How does the hero fit on a phone?
The actions sit above the calculator, so the Shine Button ends about 350 px down the first screen and the slider starts just below it. The calculator's two sides stack, the slider side first, with a hairline between them instead of the vertical divider; the figure drops from text-6xl to text-5xl.
Related
- Pro
A centered single-plan hero with a monthly and annual switch under the headline, then one band split by a hairline: the price beside a Shine Button, and six included features.
- Pro
Centered Progress Bar Hero
Updates and timelinesA compact centered launch hero with a full-width progress bar that fills on load, four milestone cells divided at the quarter marks, the Shine Button and a second action.
- Pro
Animated Counter Hero
Stats and live dataA compact centered hero for an invoicing app with an announcement pill, a Shine Button and a second action, over a hairline band of four figures that count up when they scroll into view.
- Pro
Counter Stats Hero
Stats and live dataA compact, start-aligned hero for an email API on solid rails: a headline, a Shine Button and an outline button, then four counters in separate cells whose hairlines overshoot their corners.
- Pro
Hero With Stats
Stats and live dataA split hero with a headline, a Shine Button and a second action beside a rail of four key figures on shared hairlines, each with its period and a small bar trend.
- Pro
Centered Uptime Status Rows Hero
Stats and live dataA showcase centered hero for an API platform, with a live status pill, a Shine Button and a status panel of full-width bands: five services' uptime over the last 30 days.