The invoice beside its history: send it, record a payment in full or in part, mark it paid or void it, and print it.
Installation
When to use
- An invoice beside its history: send it, record a payment in full or in part, void it, print it.
- Invoicing, accounting and agency tools that bill clients.
When not to use
- Subscriptions billed automatically: Billing settings lists their invoices.
- Receipts for one-time purchases: an order's detail is enough.
Usage
Invoice with your own data: every prop has the sample as its default, so pass only what you have.
"use client"
import { InvoiceDetail } from "@/components/dashral/blocks/invoice-detail"
export default function Invoice() {
return (
<InvoiceDetail
invoice={{
number: "INV-0042",
issued: "Nov 7, 2026",
due: "Nov 21, 2026",
from: { name: "Acme Studio", address: ["12 Market Street", "Jakarta"] },
to: { name: "Globex", address: ["5 Harbor Road", "Berlin"], email: "billing@globex.com" },
items: [
{ description: "Website redesign", qty: 1, price: 4_800 },
{ description: "Hosting", detail: "12 months", qty: 12, price: 25 },
],
taxRate: 11,
status: "sent",
paid: 0,
events: [{ id: 1, title: "Invoice sent", time: "Nov 7, 10:12", kind: "sent" }],
}}
currency="EUR"
onSend={(email) => console.log("send to", email.to)}
onRecordPayment={(amount) => console.log("paid", amount)}
onVoid={() => console.log("void")}
onDownload={() => window.print()}
/>
)
}API reference
InvoiceDetail
An invoice page: the document itself — sender and client, line items, discount, tax and total, payment details — beside what's happened to it. Send it by email, record a payment (in full or in part), mark it paid, void it or download it; the status, the amount due and the history follow. Download prints just the document. The invoice comes from props, and every action calls your handler first: one that throws changes nothing and says why.
| Prop | Type | Default |
|---|---|---|
invoice | InvoiceData | sample |
sender | stringWho signs the email in Send. | "Olivia" |
currency | string | "USD" |
locale | string | "en-US" |
onSend | (email: { to: string; message: string }) => Promise<void> | void | — |
onRecordPayment | (amount: number) => Promise<void> | void | — |
onVoid | () => Promise<void> | void | — |
onDuplicate | () => Promise<void> | void | — |
onDownload | () => voidDownload: your PDF (it prints the document without it). | — |
type InvoiceStatus
= "draft" | "sent" | "partial" | "paid" | "void"type InvoiceEvent
| Prop | Type | Default |
|---|---|---|
id | number | string | — |
title | string | — |
time | string | — |
kind | "created" | "sent" | "viewed" | "payment" | "void" | — |
type InvoiceData
The invoice: who it's from and to, what's on it, how to pay it, where it stands and what's happened to it.
| Prop | Type | Default |
|---|---|---|
number | string | — |
issued | string | — |
due | string | — |
overdue | stringBeside the status while it's overdue, e.g. "Due Oct 15 · 2 days late", and what the payment card says then. | — |
overdueNote | string | — |
from | { name: string; mark?: string; address: string[] } | — |
to | { name: string; address: string[]; email: string } | — |
items | { description: string; detail?: string; qty: number; price: number }[] | — |
discount | numberShares: 0.05 is 5%. | — |
taxRate | number | — |
payment | { title: string; rows: { label: string; value: string }[] } | nullHow to pay: a heading and its rows; null hides it. | — |
notes | string | — |
status | InvoiceStatus | — |
paid | number | — |
events | InvoiceEvent[] | — |