Invoice Editor
Data · InvoiceEditor, InvoicePreview
An outgoing invoice as a form beside the InvoicePreview it becomes: customer picker, line items with quantity, unit, unit price, VAT rate and discount, a discount on the whole invoice, the note and the totals per rate. The preview updates as you type. It sits beside the form from 1100px (stackBelow), under it below that, and on phones (below 640px) the form and the preview become tabs.
value/onChange(ordefaultValue) hold the draft:customer,lines(id,description,quantity,price,vat,discount,unit),discountandnote.vatRatesare data (default 19 %, 7 % and 0 %): pass your country's rates.unitsadds the unit column.- Sums come from
invoiceTotals(lines, { discount }): each line rounded to cents, VAT once per rate on the rate's net. Run the same function on your server and the numbers match to the cent. - Numbers are typed in the provider's locale (
1,5in German) and money is formatted withIntl. previewpasses InvoicePreview's own props (number, from, dates, brand);preview={false}hides it.headadds fields at the top,actionsthe buttons under the totals.
Amount€960.00
Amount€585.00
Amount€222.00
The number is given when the invoice is issued.
- Subtotal
- €1,767.00
- VAT 19% on €1,545.00
- €293.55
- VAT 7% on €222.00
- €15.54
- Total
- €2,076.09
Halo
Halo Workspace GmbH · Example Street 1 · 20457 Hamburg
Invoice
#2097
Team plan · 40 seats · May 2026 × 40€960.00
Onboarding workshop (half day) · Discount 10%€585.00
Printed handbook × 12€222.00
Net€1,767.00
VAT 19%€293.55
VAT 7%€15.54
Total due€2,076.09
Thank you for your business. Please pay within 14 days.
Props
InvoiceEditor
| Prop | Type | Notes |
|---|---|---|
value? | InvoiceDraft | |
defaultValue? | InvoiceDraft | |
onChange? | (value: InvoiceDraft) => void | |
customers? | { id: string; name: string; detail?: string }[] | The customer picker's options. |
customerAction? | ReactNode | Beside the picker, e.g. a "New customer" button. |
head? | ReactNode | More fields at the top: dates, payment terms, number. |
vatRates? | { value: number; label?: string }[] | The VAT rates to pick from, in percent (default 19, 7 and 0). Your country's rates are data. |
units? | string[] | Units to pick per line (hours, days, pieces …); omitted: no unit column. |
currency? | string | Currency for amounts (default the provider's, euros). |
lineDiscounts? | boolean | Discount per line (default true). |
invoiceDiscount? | boolean | Discount on the whole invoice (default true). |
notes? | boolean | The note field (default true). |
newLine? | () => InvoiceDraftLine | A new line (e.g. with your id); default an empty line with the first VAT rate. |
preview? | Partial<Omit<InvoicePreviewProps, "lines">> | false | The live InvoicePreview beside the form (its number, from, dates …); `false` hides it. `to` defaults to the picked customer, the lines and the note come from the editor. |
stackBelow? | number | Below this width (default 1100px) the preview moves under the form; below 640px they become tabs. |
actions? | ReactNode | Under the totals: save, issue. |
footnote? | ReactNode | Small print beside the totals ("The number is given when the invoice is issued"). |
readOnly? | boolean | |
className? | string | Extra class on the root element. |
style? | CSSProperties | Inline style on the root element. |
InvoicePreview
| Prop | Type | Notes |
|---|---|---|
number | string | number | Required |
from? | string | |
to | string | Required |
issued | string | Required |
due | string | Required |
lines | { d: string; q: number; u: number; v: number; discount?: number }[] | Lines: description, quantity, unit price, VAT rate in percent, optional discount in percent. |
discount? | number | Discount on the whole invoice in percent (shown as subtotal, discount, net). |
note? | string | |
kind? | string | |
brand? | string | |
format? | (n: number) => string | |
className? | string | Extra class on the root element. |
style? | CSSProperties | Inline style on the root element. |