Billing Payment Failure Recovery
A focused recovery alert for the moment a charge fails. It surfaces the specific reason a card was declined, shows which card was used, and gives the user two clear ways forward: retry the same card or add a new one. Built for billing dashboards and account settings pages where recovering the payment matters more than anything else on screen.
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-payment-failure-recovery.jsonPrefer not to use the CLI? Copy the source from the Code toggle above into src/components/blocks/billing/billing85.tsx instead.
Usage
The file also exports billing85Demo, 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 { Billing85, billing85Demo } from "@/components/blocks/billing/billing85"; export default function Page() { return <Billing85 {...billing85Demo} />; }
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| eyebrow | string | "Payment failed" | Small label above the heading. |
| heading | string | "We couldn't process your last payment" | Main headline. |
| reason | string | none | Optional decline reason from your payment gateway, shown under the heading. |
| cardBrand | string | none | Card brand of the failed payment method, e.g. "Visa". Shown together with cardLast4. |
| cardLast4 | string | none | Last 4 digits of the failed card. Shown together with cardBrand. |
| retryLabel | string | "Retry payment" | Label on the primary retry button. |
| retryHref | string | none | Destination for the retry action. |
| addCardLabel | string | "Use another card" | Label on the secondary button. |
| addCardHref | string | none | Destination for adding a new payment method. |
| supportHref | string | none | Optional link to a support or help page, omitted if not passed. |
| supportLabel | string | "Contact support" | Label for the support link. |
| className | string | none | Extra classes for the outer alert container. |
Behavior notes
- This is a static alert, not a live retry form. retryHref and addCardHref are real links (rendered through the Button component's render prop), so wire them to your actual retry endpoint and add-card flow.
- cardBrand and cardLast4 only render when both are provided, so the alert still reads fine if you don't have the failed card's details on hand.
- The reason text is passed through as-is, so use your payment gateway's own decline message (for example "Insufficient funds" or "Incorrect CVC") rather than a generic string.
- supportHref is optional; the support link is omitted entirely when it isn't passed, rather than rendering a dead link.
- The alert renders with role="alert" so assistive tech announces the failure as soon as it mounts.
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.