Staaarter

Billing Payment Method Expiry

A warning list that surfaces saved cards nearing or past their expiration date before they cause a failed charge. Each row shows the card, its expiry, and a color-coded urgency level, amber for expiring soon and red for already expired, with a direct link to update it. Built for account settings and billing dashboards as an early line of defense against involuntary churn.

By Staaarter Team
Billing
Updated March 30, 2026
Docs
Live preview

Docs

Installation

A real shadcn registry command, not a copy-paste stand-in: it fetches this block plus its button dependencies and any missing npm packages, and installs them straight into your project.

npx shadcn add https://staaarter.com/r/billing-payment-method-expiry.json

Prefer not to use the CLI? Copy the source from the Code toggle above into src/components/blocks/billing/billing87.tsx instead.

Usage

The file also exports billing87Demo, the exact props behind the preview above. Spread it to get a working section in one line, then replace it with your own data.

import { Billing87, billing87Demo } from "@/components/blocks/billing/billing87";

export default function Page() {
  return <Billing87 {...billing87Demo} />;
}

Props

PropTypeDefaultDescription
headingstring"Payment methods expiring soon"Heading above the list.
descriptionstringnoneOptional supporting text under the heading.
cardsExpiringPaymentMethod[]noneCards rendered as-is, in the order given.
updateLabelstring"Update card"Label on each row's action button.
classNamestringnoneExtra classes for the outer container.

Types

export type PaymentMethodUrgency = "expiring" | "expired";

interface ExpiringPaymentMethod {
  id: string;
  brand: string;
  last4: string;
  expMonth: number;
  expYear: number;
  urgency: PaymentMethodUrgency;
  updateHref: string;
}

Behavior notes

  • Rows are rendered in the order passed in the cards array; there's no built-in sorting by expiry date.
  • The expMonth/expYear pair is only used for display, formatted as MM/YY. Whether a card counts as "expiring" or "expired" is decided by the urgency field you pass in, not computed from today's date.
  • Urgency drives both the border/background tint and the icon: expiring cards use an amber CreditCard icon, expired cards use a red AlertTriangle icon.
  • Each row's Update card action is a next/link rendered through the Button component, so it works with a direct settings URL out of the box.
  • There's no dismiss or snooze action; once a card is passed in, its row stays until you remove it from the cards array yourself.

Frequently asked questions