# Payment Card URL: /docs/components/payment-card A comprehensive payment interface for processing final transactions with card details, billing information, and visual card preview. *** title: Payment Card description: A comprehensive payment interface for processing final transactions with card details, billing information, and visual card preview. ------------------------------------------------------------------------------------------------------------------------------------------------- ```tsx title="src/components/payment-card-demo.tsx" "use client"; import { PaymentCard } from "@/components/billingsdk/payment-card"; export function PaymentCardDemo() { return ( { console.log( `Payment Processed! ${cardNumber}, exp ${expiry}, cvc ${cvc}`, ); }} /> ); } export default PaymentCardDemo; ``` ## Installation ```bash npx shadcn@latest add @billingsdk/payment-card ``` ```bash pnpm dlx shadcn@latest add @billingsdk/payment-card ``` ```bash yarn dlx shadcn@latest add @billingsdk/payment-card ``` ```bash bunx shadcn@latest add @billingsdk/payment-card ``` ```bash npx @billingsdk/cli add payment-card ``` ```bash pnpm dlx @billingsdk/cli add payment-card ``` ```bash yarn dlx @billingsdk/cli add payment-card ``` ```bash bunx @billingsdk/cli add payment-card ``` ## Usage ```tsx import { PaymentCard, type PaymentCardProps } from "@/components/billingsdk/payment-card"; ``` ```tsx { alert(`Payment Processed! ${cardNumber}, exp ${expiry}, cvc ${cvc}`); }} /> ``` ## Props | Prop | Type | Required | Description | | --------------------- | -------------------------------------------------------------------------------------- | -------- | --------------------------------------------------- | | `title` | `string` | ✅ | Main heading shown above the form | | `description` | `string` | ✅ | Short description under the title | | `price` | `string` | ✅ | Amount displayed on the summary card (e.g. `"100"`) | | `onPay` | `(data: { cardNumber: string; expiry: string; cvc: string }) => Promise \| void` | ✅ | Callback function called when payment is submitted | | `finalText` | `{ text: string }[]` | ❌ | Rotating footer messages shown in the summary | | `feature` | `string` | ❌ | Title for the first feature section | | `featuredescription` | `string` | ❌ | Description for the first feature | | `feature2` | `string` | ❌ | Title for the second feature section | | `feature2description` | `string` | ❌ | Description for the second feature | | `className` | `string` | ❌ | Additional classes to style the root `Card` | ## Features * **Animated Interface**: Enhanced user experience with smooth animations powered by Motion for the summary panel and interactive elements * **Form Validation**: Built-in validation for credit card inputs with real-time feedback and error handling * **Responsive Design**: Optimized for all screen sizes with mobile-first approach ## Theming The Payment card component is styled using the `shadcn/ui` library. You can customize the colors and fonts by overriding the CSS variables. You can also get the theme from the [Theming](/docs/theming) page. ### Credits * Created by [@Turf](https://x.com/PotatoTurf)