Staaarter

Billing Transaction ID Copy

A focused billing support block showing a transaction's amount, date, and status alongside its full ID in a monospace field with a one-click copy button. Meant for the moment a customer needs to hand a Stripe charge or payment intent ID to support, so the number is easy to find and copy without hunting through an invoice PDF.

By Staaarter Team
Billing
Updated June 11, 2026
Docs
Live preview

Docs

Installation

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

npx shadcn add https://staaarter.com/r/billing-transaction-id-copy.json

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

Usage

The file also exports billing142Demo, 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 { Billing142, billing142Demo } from "@/components/blocks/billing/billing142";

export default function Page() {
  return <Billing142 {...billing142Demo} />;
}

Props

PropTypeDefaultDescription
headingstring"Transaction details"Heading shown at the top of the card.
transactionLabelstring"Transaction ID"Label above the ID field, e.g. "Payment Intent ID" or "Charge ID".
transactionIdstringnoneThe ID value shown in the monospace field and copied to the clipboard.
amountstringnoneOptional formatted amount shown above the ID field.
datestringnoneOptional formatted date shown next to the amount.
status"succeeded" | "pending" | "failed"noneOptional status badge shown in the header.
supportHrefstringnoneLink target for the support line; the line only renders when this is set.
supportLabelstring"Contact support"Link text for the support line.
classNamestringnoneExtra classes for the outer container.

Behavior notes

  • The copy button calls navigator.clipboard.writeText with the raw transactionId, swaps to a check icon, and shows an inline "Copied to clipboard" message for 2 seconds, matching the pattern used on the bank-transfer block elsewhere in this category.
  • If clipboard access is denied or unavailable, the copy silently no-ops and the button stays in its default state so the user can still select the text manually.
  • The copied confirmation lives in a role="status" aria-live="polite" region so screen reader users hear it without focus moving.
  • The amount/date row and the support link only render when their respective props are passed.

Frequently asked questions