BirrJS
UI Components

PaymentBlock

Full payment UI composable — channel selector, virtual bank card, reference input, and verify button.

Select Payment Method

Select a payment method to continue

Installation

birrjs add payment-block

This adds the component and all its dependencies to your project:

Non-Next.js users? If TypeScript reports Cannot find module './cbe.svg', add "globals.d.ts" to your tsconfig.json include array.

ComponentDescription
payment-blockTop-level composable: channel grid, card, order summary, input, verify button
reference-inputAnimated input with bank logo transition on channel switch
bank-payment-cardTilt-card with gradient/mono variants, account number copy
utilscn() utility (clsx + tailwind-merge)

Props

PropTypeDefaultDescription
channelsPaymentChannel[]requiredAvailable payment channels
selectedPaymentChannelType | nullrequiredCurrently selected channel
onSelect(type: PaymentChannelType) => voidrequiredChannel selection handler
receiptUrl?stringBound to reference input
onReceiptUrlChange?(value: string) => voidReceipt URL input handler
onVerify?() => voidVerify button click handler
verifying?booleanfalseShows spinner, disables input
amount?numberShows order summary card with ETB total
className?stringAdditional wrapper classes

PaymentChannel

interface PaymentChannel {
  type: "telebirr" | "cbe" | "awash";
  label: string;
  value: string;       // account number
  accountHolder?: string;
}

Customization

The components use Tailwind classes that reference your theme's CSS variables. The following variables are used:

  • --card / --card-foreground
  • --border
  • --muted-foreground
  • --primary / --primary-foreground
  • --background
  • --radius-xl

Ensure these are defined in your globals.css to match your brand.

Variants

BankPaymentCard accepts a variant prop:

VariantDescription
monoNeutral card with subtle borders — respects --card and --border
gradientBrand-colored gradient

Mono

Telebirr
251911223344
Abebe Kebede

Gradient

Telebirr
251911223344
Abebe Kebede