Billing Abandoned Checkout Alert
A dismissible alert banner for checkout pages or account dashboards, built to bring a user back to an abandoned purchase. It pairs a countdown timer with a discount reminder and a resume button, and can be dismissed without losing the countdown state until the page reloads.
Docs
Installation
A real shadcn registry command, not a copy-paste stand-in: it fetches this block plus its button dependencies and any missing npm packages, and installs them straight into your project.
npx shadcn add https://staaarter.com/r/billing-abandoned-checkout-alert.jsonPrefer not to use the CLI? Copy the source from the Code toggle above into src/components/blocks/billing/billing13.tsx instead.
Usage
The file also exports billing13Demo, 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 { Billing13, billing13Demo } from "@/components/blocks/billing/billing13"; export default function Page() { return <Billing13 {...billing13Demo} />; }
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| eyebrow | string | "Limited-time offer" | Small label shown above the heading. |
| heading | string | none | Main headline, e.g. "Finish setting up your Pro plan". |
| message | string | none | Optional supporting sentence under the heading. |
| discountLabel | string | none | Text shown next to the countdown, e.g. "15% off expires in". |
| durationSeconds | number | 900 | How many seconds the countdown starts from on mount. |
| resumeLabel | string | "Resume checkout" | Label on the primary action button. |
| resumeHref | string | none | Destination the resume button links to. |
| expiredMessage | string | (see source) | Text shown once the countdown reaches zero, replacing the discount label and timer. |
| className | string | none | Extra classes for the outer alert container. |
Behavior notes
- The countdown starts from durationSeconds on mount and ticks down every second via a client-side interval; it renders the same starting value on the server so there's no hydration mismatch.
- Once the countdown reaches zero, the discount label and timer are replaced by expiredMessage, and the resume button stays active.
- Dismissing the banner sets local state to hide it entirely. There's no prop or callback to notify a parent, so track dismissal separately if you need to log it.
- The resume button renders as a next/link via the Button component's render prop, so resumeHref can point straight at a checkout route.
- The countdown text uses aria-live="polite" so screen readers pick up the changing time without the whole banner being re-announced.
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.