BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/HextaUI/billing-payment-method

Billing Payment Method

hextaui/billing-payment-method
FreeComponent

Manage payment methods with add, edit, delete, and set default options.

Live preview

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

Install it

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

Source

registry/new-york/blocks/billing/billing-payment-method.tsxhextaui.com/r/billing-payment-method.json · first 6 KB
1"use client";
2
3import { CreditCard, Loader2, MoreVertical, Plus, Trash2 } from "lucide-react";
4import { useState } from "react";
5import { cn } from "@/lib/utils";
6import {
7 AlertDialog,
8 AlertDialogAction,
9 AlertDialogCancel,
10 AlertDialogContent,
11 AlertDialogDescription,
12 AlertDialogFooter,
13 AlertDialogHeader,
14 AlertDialogTitle,
15} from "@/registry/new-york/ui/alert-dialog";
16import { Badge } from "@/registry/new-york/ui/badge";
17import { Button } from "@/registry/new-york/ui/button";
18import {
19 Card,
20 CardContent,
21 CardDescription,
22 CardHeader,
23 CardTitle,
24} from "@/registry/new-york/ui/card";
25import {
26 DropdownMenu,
27 DropdownMenuContent,
28 DropdownMenuItem,
29 DropdownMenuSeparator,
30 DropdownMenuTrigger,
31} from "@/registry/new-york/ui/dropdown-menu";
32
33export interface PaymentMethod {
34 id: string;
35 type: "card" | "bank_account" | "paypal" | "other";
36 last4?: string;
37 brand?: "visa" | "mastercard" | "amex" | "discover" | "other";
38 expiryMonth?: number;
39 expiryYear?: number;
40 holderName?: string;
41 isDefault?: boolean;
42 billingAddress?: {
43 line1?: string;
44 city?: string;
45 state?: string;
46 zip?: string;
47 country?: string;
48 };
49}
50
51export interface BillingPaymentMethodProps {
52 paymentMethods: PaymentMethod[];
53 onAdd?: () => void;
54 onEdit?: (methodId: string) => void;
55 onDelete?: (methodId: string) => void;
56 onSetDefault?: (methodId: string) => void;
57 className?: string;
58 allowMultiple?: boolean;
59 isLoading?: boolean;
60}
61
62function getCardBrandIcon(brand?: PaymentMethod["brand"]) {
63 switch (brand) {
64 case "visa":
65 return "💳";
66 case "mastercard":
67 return "💳";
68 case "amex":
69 return "💳";
70 case "discover":
71 return "💳";
72 default:
73 return "💳";
74 }
75}
76
77function formatExpiry(month?: number, year?: number): string {
78 if (!(month && year)) return "";
79 const monthStr = month.toString().padStart(2, "0");
80 const yearStr = year.toString().slice(-2);
81 return `${monthStr}/${yearStr}`;
82}
83
84export default function BillingPaymentMethod({
85 paymentMethods,
86 onAdd,
87 onEdit,
88 onDelete,
89 onSetDefault,
90 className,
91 allowMultiple = true,
92 isLoading = false,
93}: BillingPaymentMethodProps) {
94 const [deleteDialogOpen, setDeleteDialogOpen] = useState(false);
95 const [deletingId, setDeletingId] = useState<string | null>(null);
96
97 const handleDelete = async (methodId: string) => {
98 setDeletingId(methodId);
99 setDeleteDialogOpen(true);
100 };
101
102 const confirmDelete = async () => {
103// … truncated

What it pulls in

Other registry items

  • alert-dialog
  • badge
  • button
  • card
  • dropdown-menu

Files it writes

  • registry/new-york/blocks/billing/billing-payment-method.tsx

Facts

Registry
HextaUI
Type
registry:ui
Access
Free
Files written
1
Licence
the repository states none
First indexed
2026-08-01
Last confirmed
today

Go to the source

Docs on HextaUI hextaui.com preetsuthar17/HextaUI on GitHub Raw registry item This item as JSON

More from HextaUI

All 139 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
AccordionaccordionHextaUIComponentsFree1 dep
AI Chat Historyai-chat-historyHextaUIComponentsFreeno deps
AI Citationsai-citationsHextaUIComponentsFreeno deps
AI Conversationai-conversationHextaUIComponentsFreeno deps
AI Error Handlerai-error-handlerHextaUIComponentsFreeno deps
AI File Uploadai-file-uploadHextaUIComponentsFreeno deps
AI Messageai-messageHextaUIComponentsFree4 deps
AI Model Selectorai-model-selectorHextaUIComponentsFreeno 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