Billing Early Renewal Bonus
A renewal-incentive card for account and billing settings pages. It shows how many days are left in the current renewal window with a progress bar, highlights a bonus (extra credits, a feature unlock, a price lock) for renewing early, and links straight to a renew action. Built for SaaS billing flows that want to smooth out cash flow by pulling renewals forward.
Docs
Installation
A real shadcn registry command, not a copy-paste stand-in: it fetches this block plus its badge, button dependencies and any missing npm packages, and installs them straight into your project.
npx shadcn add https://staaarter.com/r/billing-early-renewal-bonus.jsonPrefer not to use the CLI? Copy the source from the Code toggle above into src/components/blocks/billing/billing51.tsx instead.
Usage
The file also exports billing51Demo, the exact props behind the preview above. Spread it to get a working section in one line, then replace it with your own data.
import { Billing51, billing51Demo } from "@/components/blocks/billing/billing51"; export default function Page() { return <Billing51 {...billing51Demo} />; }
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| heading | string | "Renew early and get a bonus" | Card heading. |
| description | string | none | Optional supporting sentence under the heading. |
| planName | string | none | Optional plan name shown next to the days-left label. |
| daysRemaining | number | none | Days left in the early-renewal window. Clamped between 0 and windowDays for display. |
| windowDays | number | 60 | Total length of the early-renewal window in days, used to size the progress bar. |
| bonusLabel | string | none | What the customer gets for renewing early, e.g. "10% extra API credits". |
| bonusValueLabel | string | none | Optional dollar value of the bonus, shown under bonusLabel. |
| renewLabel | string | "Renew now" | Label on the renew button. |
| renewHref | string | none | Destination the renew button links to. |
| className | string | none | Extra classes for the outer container. |
Behavior notes
- The progress bar fills based on daysRemaining divided by windowDays, and its color switches from the primary color to amber once 20% or less of the window is left, as a soft visual cue to act soon.
- daysRemaining is clamped between 0 and windowDays before it's used for the bar or the day count text, so passing a value outside that range won't overflow or invert the bar.
- There's no countdown timer or interval, the days-left number is static per render. Recompute it server-side from the actual renewal date and pass it in fresh.
- The renew button renders as a next/link via the Button component's render prop, so renewHref can point straight at a pre-filled checkout session.
Frequently asked questions
More Billing Blocks
View all →Billing Invoice List
Invoice history table with status badges, formatted amounts, and a per-row download link, built with shadcn/ui and Tailwind CSS.
Billing Failed Payment Alert
High-contrast failed-payment alert with a message, a retry button, and an optional update-payment-method button, built with shadcn/ui and Tailwind CSS.
Billing Credit Balance
Compact credit balance card with a large total, an optional purchased-versus-promotional breakdown, a low-balance notice, and a top-up button.
Billing Payment Methods
A saved payment method list for React and Next.js with brand icons, a default badge, near-expiry warnings, and remove/set-default actions per row.
Billing Add Card
A card entry form for React and Next.js with auto-formatted fields, internal brand detection, and per-field validation feedback built with shadcn/ui and Tailwind CSS.
Billing Coupon Code
An inline promo code input for React and Next.js with a simulated loading state, an applied summary showing the discount amount, and an invalid-code message.