Bangladesh
Payment method picker
bKash, Nagad, Rocket, Upay, card, cash, bank, cash on delivery. Cards, list or chips; fees beside each.
Cards, with fees
List, every method
Chips
"use client";
import { PaymentMethodPicker } from "@waveinno/ui";
import * as React from "react";
export default function PaymentDemo() {
const [method, setMethod] = React.useState("bkash");
return (
<div className="grid gap-8 lg:grid-cols-2">
<div>
<p className="mb-2 text-[13px] font-medium text-text">Cards, with fees</p>
<PaymentMethodPicker value={method} onValueChange={setMethod} fees={{ bkash: "1.85%", nagad: "1.5%", card: "2.5%", cash: "Free" }} />
</div>
<div className="space-y-6">
<div>
<p className="mb-2 text-[13px] font-medium text-text">List, every method</p>
<PaymentMethodPicker variant="list" methods={["bkash", "nagad", "rocket", "upay", "card", "bank", "cod"]} defaultValue="cod" />
</div>
<div>
<p className="mb-2 text-[13px] font-medium text-text">Chips</p>
<PaymentMethodPicker variant="chips" methods={["bkash", "nagad", "card", "cash"]} />
</div>
</div>
</div>
);
}Examples#
Each one on its own: copy its code into your app, or copy it to Figma and paste it on the canvas as layers.
Cards with fees
For checkout: each method with its fee beside it.
"use client";
import { PaymentMethodPicker } from "@waveinno/ui";
import * as React from "react";
export default function PaymentCardsExample() {
const [method, setMethod] = React.useState("bkash");
return (
<div className="w-full max-w-md">
<PaymentMethodPicker value={method} onValueChange={setMethod} fees={{ bkash: "1.85%", nagad: "1.5%", card: "2.5%", cash: "Free" }} />
</div>
);
}List
Every method in a column: for a payment settings page.
"use client";
import { PaymentMethodPicker } from "@waveinno/ui";
export default function PaymentMethodPickerListExample() {
return (
<div className="w-full max-w-sm"><PaymentMethodPicker variant="list" methods={["bkash", "nagad", "rocket", "upay", "card", "bank", "cod"]} defaultValue="cod" /></div>
);
}Chips
Compact, for a filter or a small form.
"use client";
import { PaymentMethodPicker } from "@waveinno/ui";
export default function PaymentMethodPickerChipsExample() {
return (
<PaymentMethodPicker variant="chips" methods={["bkash", "nagad", "card", "cash"]} />
);
}Animated#
Motion that earns its place: free ones to copy now, and Pro ones whose code and Figma copy come with a Wavi Pro licence. They respect the visitor's reduced-motion setting.
Pay with bKash Pro
The amount, the PIN dots filling, a short progress and the transaction ID.
bKash payment
৳1,250.00
To Gulshan Parking · Invoice 1042
Enter your bKash PIN
This example's code comes with Wavi Pro
One payment for every Pro component, block and template, with every update.
Import#
Everything comes from the package root. The example above uses:
import { PaymentMethodPicker } from "@waveinno/ui";Props#
Read from the source of this version, so they match the code exactly.
<PaymentMethodPicker>
src/components/ui/payment-method-picker.tsx| Prop | Type | Default | Description |
|---|---|---|---|
value | string | — | |
defaultValue | string | — | |
onValueChange | (id: string) => void | — | |
methods | (PaymentMethodId | PaymentMethod)[] | ["bkash", "nagad", "card", "cash"] | |
fees | Partial<Record<string, React.ReactNode>> | — | Beside each method: "No fee", "1.85%", "−৳50". |
variant | "cards" | "list" | "chips" | "cards" | |
disabled | boolean | — | |
aria-label | string | "Payment method" | |
className | string | — |
Install#
If the project does not have the package yet, add it, then follow the setup for Next.js or Vite once.
$ npm install @waveinno/ui