Billing Receipt Details
A detailed receipt view for a single transaction, listing each line item with quantity and amount, then a subtotal, tax, and total, followed by a payment method summary. Meant for the expanded view a customer sees after clicking into a specific invoice from their billing history.
Docs
Installation
A real shadcn registry command, not a copy-paste stand-in: it fetches this block plus its dependencies and any missing npm packages, and installs them straight into your project.
npx shadcn add https://staaarter.com/r/billing-receipt-details.jsonPrefer not to use the CLI? Copy the source from the Code toggle above into src/components/blocks/billing/billing108.tsx instead.
Usage
The file also exports billing108Demo, 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 { Billing108, billing108Demo } from "@/components/blocks/billing/billing108"; export default function Page() { return <Billing108 {...billing108Demo} />; }
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| title | string | "Receipt" | Heading at the top of the card. |
| receiptNumber | string | none | Receipt or invoice identifier shown under the title. |
| date | string | none | Formatted date of the transaction. |
| billedTo | string | none | Optional customer or company name the receipt was billed to. |
| lineItems | ReceiptLineItem[] | none | Rows rendered in the order given; the component does not sort or total them beyond what you pass in subtotal/tax/total. |
| subtotal | string | none | Formatted subtotal before tax. |
| taxLabel | string | "Tax" | Label on the tax row, for example "Tax (8.5%)" if you want the rate included. |
| tax | string | none | Optional formatted tax amount. The tax row is omitted entirely when not set. |
| total | string | none | Formatted grand total. |
| paymentMethodLabel | string | none | Payment method summary, for example "Visa ending in 4242". |
| printHref | string | none | Optional link for a print or printable-receipt action, shown top-right when set. |
| printLabel | string | "Print" | Label next to the print icon. |
| className | string | none | Extra classes for the outer container. |
Types
interface ReceiptLineItem { id: string; description: string; quantity?: number; amount: string; }
Behavior notes
- Subtotal, tax, and total are all plain strings you compute and pass in; the component doesn't sum lineItems itself, so it stays correct even if your pricing has proration or rounding rules baked in server-side.
- The tax row only renders when tax is set, so receipts with no tax (for example a $0 invoice or a tax-exempt customer) can omit it cleanly instead of showing a $0.00 line.
- quantity defaults to 1 on any line item where it's left unset.
- Print is a next/link, not a window.print() call, so by default it can point at a server-generated PDF or a hosted receipt URL from your billing provider. Swap it for a client-side print trigger if you'd rather open the browser's print dialog directly.
- The layout uses plain table markup for the line items, so it stays legible when copied into an email or exported to PDF.
Frequently asked questions
More Billing Blocks
View all →Billing Invoice List
Invoice history table with status badges, formatted amounts, and a per-row download link, built with shadcn/ui and Tailwind CSS.
Billing Failed Payment Alert
High-contrast failed-payment alert with a message, a retry button, and an optional update-payment-method button, built with shadcn/ui and Tailwind CSS.
Billing Credit Balance
Compact credit balance card with a large total, an optional purchased-versus-promotional breakdown, a low-balance notice, and a top-up button.
Billing Payment Methods
A saved payment method list for React and Next.js with brand icons, a default badge, near-expiry warnings, and remove/set-default actions per row.
Billing Add Card
A card entry form for React and Next.js with auto-formatted fields, internal brand detection, and per-field validation feedback built with shadcn/ui and Tailwind CSS.
Billing Coupon Code
An inline promo code input for React and Next.js with a simulated loading state, an applied summary showing the discount amount, and an invalid-code message.