# Payment Method Selector
URL: /docs/components/payment-method-selector
Interactive selector for Cards, Digital Wallets, UPI (India), and BNPL services with inline forms and smooth motion.
***
title: Payment Method Selector
description: Interactive selector for Cards, Digital Wallets, UPI (India), and BNPL services with inline forms and smooth motion.
---------------------------------------------------------------------------------------------------------------------------------
## Preview
```tsx title="src/components/payment-method-selector-demo.tsx"
"use client";
import { PaymentMethodSelector } from "@/components/billingsdk/payment-method-selector";
export function PaymentMethodSelectorDemo() {
return (
{
console.log("Demo: Proceed with:", method, data);
}}
/>
);
}
```
## Installation
```bash
npx shadcn@latest add @billingsdk/payment-method-selector
```
```bash
pnpm dlx shadcn@latest add @billingsdk/payment-method-selector
```
```bash
yarn dlx shadcn@latest add @billingsdk/payment-method-selector
```
```bash
bunx shadcn@latest add @billingsdk/payment-method-selector
```
```bash
npx @billingsdk/cli add payment-method-selector
```
```bash
pnpm dlx @billingsdk/cli add payment-method-selector
```
```bash
yarn dlx @billingsdk/cli add payment-method-selector
```
```bash
bunx @billingsdk/cli add payment-method-selector
```
## Usage
```tsx
import { PaymentMethodSelector } from "@/components/billingsdk/payment-method-selector"
```
```tsx
{
console.log("Selected method:", method)
console.log("Form data:", data)
}}
/>
```
## Props
| Prop | Type | Description |
| ----------- | ------------------------------------------------- | ---------------------------------------------------------------------------------- |
| `onProceed` | `(method: PaymentMethod, data: FormData) => void` | Fired on “Proceed with Payment”. Receives selected method and collected form data. |
| `className` | `string` | Optional class names for the root container. |
### Types
```ts
type PaymentMethod = "cards" | "digital-wallets" | "upi" | "bnpl-services"
type FormData = {
// Cards
cardNumber?: string
expiryDate?: string
cvv?: string
cardholderName?: string
// Wallets
email?: string
phone?: string
// UPI
upiId?: string
// BNPL
income?: string
}
```
## Payment Methods
* **Cards**
* Form: card number, expiry, CVV, name
* Notes: secure card payments with fraud protection
* **Digital Wallets** (Apple Pay, Google Pay, Cash App, Venmo)
* Form: email, phone
* Notes: quick checkout, biometric auth
* **UPI (India)** (PhonePe, Google Pay, Paytm, BHIM)
* Form: UPI ID
* Notes: real‑time bank transfers
* **BNPL Services** (Klarna, Affirm, Afterpay, Sezzle)
* Form: email, phone, income (optional)
* Notes: split payments, flexible terms
## Theming
Styled with `shadcn/ui`. Customize via CSS variables or switch themes in the preview header. See [Theming](/docs/theming).
## Example
```tsx title="src/components/payment-method-selector-demo.tsx"
"use client";
import { PaymentMethodSelector } from "@/components/billingsdk/payment-method-selector";
export function PaymentMethodSelectorDemo() {
return (
{
console.log("Demo: Proceed with:", method, data);
}}
/>
);
}
```
### Credits
* Created by [@rajoninternet](https://x.com/rajoninternet)