Billing History
A month-grouped timeline of invoices, failed payments, plan changes and card updates with amounts.
import {
ArrowsClockwiseIcon,
CreditCardIcon,
ReceiptIcon,
WarningIcon,
} from "@phosphor-icons/react/ssr"
import {
Card,
CardContent,
CardDescription,
CardHeader,
CardTitle,
} from "@/components/ui/card"
const COPY = {
title: "Billing history",
description: "Charges, refunds and plan changes in one place.",
} as const
type Kind = "charge" | "failed" | "plan" | "card"
const ICONS: Record<Kind, typeof ArrowsClockwiseIcon> = {
charge: ReceiptIcon,
failed: WarningIcon,
plan: ArrowsClockwiseIcon,
card: CreditCardIcon,
}
const GROUPS = [
{
month: "November 2026",
events: [
{
kind: "charge",
title: "Invoice INV-2041 issued",
detail: "Pro plan, 15 seats",
amount: "$348.00",
date: "Nov 1",
},
],
},
{
month: "October 2026",
events: [
{
kind: "plan",
title: "Upgraded from Starter to Pro",
detail: "Prorated credit of $11.40 applied",
amount: "-$11.40",
date: "Oct 14",
},
{
kind: "charge",
title: "Invoice INV-2036 paid",
detail: "Visa ending 4242",
amount: "$348.00",
date: "Oct 1",
},
],
},
{
month: "September 2026",
events: [
{
kind: "card",
title: "Visa ending 4242 added",
detail: "Set as default method",
amount: "",
date: "Sep 20",
},
{
kind: "failed",
title: "Payment failed, retried",
detail: "Mastercard ending 8810 declined",
amount: "$312.50",
date: "Sep 2",
},
],
},
] as const
export default function BillingHistoryTimeline() {
return (
<Card className="mx-auto w-full max-w-xl">
<CardHeader>
<CardTitle>{COPY.title}</CardTitle>
<CardDescription>{COPY.description}</CardDescription>
</CardHeader>
<CardContent className="flex flex-col gap-6">
{GROUPS.map((group) => (
<section key={group.month} className="flex flex-col gap-3">
<h3 className="text-xs font-medium tracking-wide text-muted-foreground uppercase">
{group.month}
</h3>
<ol className="flex flex-col">
{group.events.map((event, index) => {
const Glyph = ICONS[event.kind]
return (
<li key={event.title} className="flex gap-3">
<div className="flex flex-col items-center">
<span className="flex size-8 items-center justify-center rounded-full bg-muted">
<Glyph className="size-4" />
</span>
{index < group.events.length - 1 && (
<span className="my-1 w-px flex-1 bg-border" />
)}
</div>
<div className="flex flex-1 items-start justify-between gap-3 pb-5">
<div className="flex flex-col">
<span className="text-sm font-medium">
{event.title}
</span>
<span className="text-xs text-muted-foreground">
{event.detail} · {event.date}
</span>
</div>
<span className="text-sm tabular-nums">
{event.amount}
</span>
</div>
</li>
)
})}
</ol>
</section>
))}
</CardContent>
</Card>
)
}
Installation
pnpm dlx shadcn@latest add @01orbital/billing-history-01npx shadcn@latest add @01orbital/billing-history-01yarn dlx shadcn@latest add @01orbital/billing-history-01bunx --bun shadcn@latest add @01orbital/billing-history-01Make it yours
- Its words are in
COPYat the top ofcomponents/blocks/feed/billing-history-01/index.tsx: change them there, not in the markup. ICONSandGROUPS, also at the top of the file, hold its lists and settings.
Built from
npm: @phosphor-icons/react. The CLI installs it for you.
Built from these parts. The CLI adds each one that is missing and won't replace a file you already have unless you choose to:
The shadcn parts here are their Base UI versions, and this piece uses Base UI's API. A Radix version you already have won't work with it.
Last updated on