Components

BaseDocument

A business document such as an invoice, quote or receipt, with parties, lines, totals and a note.

components/ui/BaseDocument.vue
View in the demo

Example

Tandria Studio S.A.S. · 1792345678001Quito, Ecuador
QuoteQT-0318
Prepared forHarbor & Pine [email protected]
Issued 3 Nov 2026Valid until 3 Dec 2026
Item
Qty
Price
Amount
Discovery workshop1$900.00$900.00
Design system setup3$640.00$1,920.00
Subtotal
$2,820.00
VAT (12%)
$338.40

Total
$3,158.40
Prices include two review rounds.

BaseDocument only takes props: it knows nothing about invoices. A module maps its record onto it in a small component of its own, so the same layout serves invoices, quotes, receipts or order confirmations. InvoiceDocument is the reference: it passes the issuer, the client, the dates as meta, the lines and the totals it computes, and the invoice editor shows it as a live preview next to the form.

vue
<BaseDocument
  :title="$t('invoices.preview.invoice')"
  :number="invoice.id"
  :issuer="{ name: issuer.name, code: issuer.taxId, lines: [issuer.address] }"
  :recipient="{ name: invoice.client, lines: [invoice.address, invoice.email] }"
  :recipient-label="$t('invoices.preview.billTo')"
  :meta="[issuedLabel, dueLabel]"
  :lines="invoice.lines"
  :totals="totals"
  :note="invoice.note"
/>

Amounts use the default currency; each line's amount is quantity × price unless you pass amount. The column headers come from document.* in locales/<code>/common.json.

print(), exposed through a template ref, opens the browser's print dialog with only the document: it is copied into a light-theme root while the dialog is open, the rest of the page is hidden, and the tab is renamed to the title and number so "Save as PDF" suggests Invoice INV-0042.pdf. Rows never split across pages. The "Download PDF" actions of the invoice quick view use it.

vue
<BaseDocument ref="invoiceDocument" v-bind="documentProps" />
<BaseButton prepend-icon="download" @click="invoiceDocument?.print()">Download PDF</BaseButton>

To print any other element the same way, call usePrintElement().print(element, { title }).

API

Props

Name
Type
Default
Description
title
required
string—The document type shown large at the top end, such as "Invoice", "Quote" or "Receipt".
numberstring—The document number under the title, in the monospace font.
issuerDocumentParty—Who issues it: { name, code?, lines? }. code (a tax id) follows the name in the monospace font and each line is a smaller row, such as the address.
recipientDocumentParty—Whom it is for, with the same shape as issuer.
recipient-labelstring—The small uppercase label over the recipient, such as "Bill to".
meta(string | null)[][]Short facts aligned to the end next to the recipient, such as the issue and due dates. Empty values are skipped.
linesDocumentLine[]—The rows { description, quantity, price, amount? }; amount defaults to quantity × price and amounts use the default currency.
totalsSummaryListItem[]—The totals block under the lines, rendered by BaseSummaryList.
notestring—A note in the muted box at the bottom.
footnotestring—A second, quieter line in that box, such as the payment details.
logobooleantrueShows the app logo above the issuer.
empty-textstring—The message of the lines table while it has no rows.

Slots

Name
Slot props
Description
#brandanyReplaces the logo above the issuer, for example with a client logo.
#footeranyReplaces the note and footnote inside the muted box.
© 2026 melsami UI.
Developer documentation for melsami UI.