Payment Failure
billingsdk/payment-failureFreeBlock
A payment failure card component with retry, home, and support actions.
Install it
npx shadcn@latest add https://billingsdk.com/r/payment-failure.jsonSource
1"use client";23import * as React from "react";4import { XCircle, RefreshCw, Home, Mail } from "lucide-react";5import { Button } from "@/components/ui/button";6import {7 Card,8 CardContent,9 CardDescription,10 CardFooter,11 CardHeader,12 CardTitle,13} from "@/components/ui/card";14import { cn } from "@/lib/utils";1516export interface PaymentFailureProps extends React.HTMLAttributes<HTMLDivElement> {17 /**18 * Optional heading at the top.19 * @default "Payment Failed"20 */21 title?: string;2223 /**24 * Short description under the title.25 * @default "We couldn't process your payment."26 */27 subtitle?: string;2829 /**30 * Extra explanatory message under the reasons list.31 * @default "Please check your payment details and try again, or contact your bank for more information."32 */33 message?: string;3435 /**36 * Bullet points explaining common failure reasons.37 */38 reasons?: string[];3940 /**41 * Whether the primary action is in loading / retrying state.42 */43 isRetrying?: boolean;4445 /**46 * Label for the primary CTA button.47 * @default "Try Again"48 */49 retryButtonText?: string;5051 /**52 * Label for the secondary button (e.g. Home).53 * @default "Home"54 */55 secondaryButtonText?: string;5657 /**58 * Label for the tertiary button (e.g. Support).59 * @default "Support"60 */61 tertiaryButtonText?: string;6263 /**64 * Called when user clicks the primary CTA (Try Again).65 */66 onRetry?: () => void;6768 /**69 * Called when user clicks the secondary button (Home).70 */71 onSecondary?: () => void;7273 /**74 * Called when user clicks the tertiary button (Support).75 */76 onTertiary?: () => void;77}7879export const PaymentFailure = React.forwardRef<80 HTMLDivElement,81 PaymentFailureProps82>(83 (84 {85 className,86 title = "Payment Failed",87 subtitle = "We couldn't process your payment.",88 message = "Please check your payment details and try again, or contact your bank for more information.",89 reasons = [90 "Insufficient funds in your account",91 "Incorrect card details or expired card",92 "Card declined by your bank",93 "Network connection issues",94 ],95 isRetrying = false,96 retryButtonText = "Try Again",97 secondaryButtonText = "Home",98 tertiaryButtonText = "Support",99 onRetry,100 onSecondary,101 onTertiary,102 ...props103 },104 ref,105 ) => {106 return (107 <Card ref={ref} className={cn("w-full max-w-md", className)} {...props}>108// … truncated
What it pulls in
npm packages
Other registry items
Files it writes
More from billingsdk
All 35 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| All Componentsall | billingsdk | Blocks | Free | no deps | |
| Top Bannerbanner | billingsdk | Blocks | Free | 2 deps · 2 files | |
| Billing Screenbilling-screen | billingsdk | Blocks | Free | 2 deps · 2 files | |
| Billing Settingsbilling-settings | billingsdk | Blocks | Free | 2 deps · 2 files | |
| Billing Settings 2billing-settings-2 | billingsdk | Blocks | Free | 1 dep · 2 files | |
| Cancel Subscription Cardcancel-subscription-card | billingsdk | Blocks | Free | 1 dep · 3 files | |
| Cancel Subscription Dialogcancel-subscription-dialog | billingsdk | Blocks | Free | 1 dep · 3 files | |
| Detailed Usage Tabledetailed-usage-table | billingsdk | Blocks | Free | no deps · 2 files |
