BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/billui/payment-method

Payment Method

billui/payment-method
FreeComponent

A composable card for displaying saved payment methods like credit cards.

Live preview

live · rendered by the registry
Rendered by billui on their own page — this is the component running, not a screenshot of it.

Install it

npx shadcn@latest add https://billui.com/r/payment-method.json

Source

src/registry/ui/payment-method.tsxbillui.com/r/payment-method.json
1import { cva, type VariantProps } from "class-variance-authority";
2import { MoreHorizontal, Pencil, Trash2 } from "lucide-react";
3import * as React from "react";
4import { Badge } from "@/components/ui/badge";
5import { Button } from "@/components/ui/button";
6import { cn } from "@/lib/utils";
7import { brandLabels, type CardBrand, CardBrandIcons } from "./card-icons";
8
9const paymentMethodVariants = cva(
10 "relative flex items-center gap-4 rounded-xl border bg-card p-4 text-card-foreground transition-colors",
11 {
12 variants: {
13 variant: {
14 default: "border-border",
15 selected: "border-primary ring-1 ring-primary",
16 },
17 },
18 defaultVariants: {
19 variant: "default",
20 },
21 },
22);
23
24interface PaymentMethodProps
25 extends React.HTMLAttributes<HTMLDivElement>,
26 VariantProps<typeof paymentMethodVariants> {}
27
28const PaymentMethod = React.forwardRef<HTMLDivElement, PaymentMethodProps>(
29 ({ className, variant, ...props }, ref) => (
30 <div
31 ref={ref}
32 className={cn(paymentMethodVariants({ variant, className }))}
33 {...props}
34 />
35 ),
36);
37PaymentMethod.displayName = "PaymentMethod";
38
39interface PaymentMethodIconProps extends React.HTMLAttributes<HTMLDivElement> {
40 brand?: CardBrand;
41}
42
43const PaymentMethodIcon = React.forwardRef<
44 HTMLDivElement,
45 PaymentMethodIconProps
46>(({ className, brand = "unknown", ...props }, ref) => {
47 const Logo = CardBrandIcons[brand] ?? CardBrandIcons.unknown;
48 const isGeneric = brand === "unknown";
49
50 return (
51 <div
52 ref={ref}
53 className={cn(
54 "flex shrink-0 items-center justify-center overflow-hidden rounded-[4px]",
55 isGeneric ? "h-8 w-8 text-muted-foreground" : "h-8 w-12",
56 className,
57 )}
58 {...props}
59 >
60 <Logo className={isGeneric ? "h-6 w-6" : "h-full w-full"} />
61 </div>
62 );
63});
64PaymentMethodIcon.displayName = "PaymentMethodIcon";
65
66const PaymentMethodDetails = React.forwardRef<
67 HTMLDivElement,
68 React.HTMLAttributes<HTMLDivElement>
69>(({ className, ...props }, ref) => (
70 <div
71 ref={ref}
72 className={cn("flex min-w-0 flex-1 flex-col gap-0.5", className)}
73 {...props}
74 />
75));
76PaymentMethodDetails.displayName = "PaymentMethodDetails";
77
78interface PaymentMethodNumberProps
79 extends React.HTMLAttributes<HTMLSpanElement> {
80 last4?: string;
81}
82
83const PaymentMethodNumber = React.forwardRef<
84 HTMLSpanElement,
85 PaymentMethodNumberProps
86>(({ className, last4, children, ...props }, ref) => (
87 <span
88 ref={ref}
89// … truncated

What it pulls in

npm packages

  • class-variance-authority
  • lucide-react

Other registry items

  • badge
  • button
  • https://billui.com/r/utils.json
  • https://billui.com/r/card-icons.json

Files it writes

  • src/registry/ui/payment-method.tsx

Facts

Registry
billui
Type
registry:ui
Access
Free
Files written
1
Licence
MIT
First indexed
2026-08-02
Last confirmed
today

Go to the source

Docs on billui billui.com commet-labs/billui on GitHub Raw registry item This item as JSON

More from billui

All 13 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
Animated Usage Cardanimated-usage-cardbilluiComponentsFree2 deps
Billing Addressbilling-addressbilluiComponentsFreeno deps
Card Iconscard-iconsbilluiComponentsFree1 dep
Card Inputcard-inputbilluiComponentsFreeno deps
Invoice Cardinvoice-cardbilluiComponentsFree2 deps
Plan Cardplan-cardbilluiComponentsFree2 deps
Plan Groupplan-groupbilluiComponentsFree1 dep
Pricing Tablepricing-tablebilluiComponentsFree2 deps
BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex