Cards JS behaviour

Invoice

A full invoice with a two-sided letterhead, rows that rise one at a time, rolling totals and a print mode (@media print) — everything is computed from the lines.

Real scenarios

The component as it is used in a product — not a specimen grid.

The March retainer, as the client prints it

Rows rise one after another, the totals roll their digits, and @media print turns it into the plain paper document. Mark it paid and watch the badge morph through the Livewire round trip.

Nabu Studio
Design engineering

Invoice

Invoice no.
INV-1404-082
Issue date
۱۴۰۴/۰۷/۰۸
Due date
۱۴۰۴/۰۷/۳۰
Awaiting payment
From

Nabu Studio

Istanbul, Türkiyehello@nabu.studioTax id 1400…
Billed to

Acme Corp

Istanbul, Türkiyeaccounts@acme.com
Invoice INV-1404-082
Item Qty Unit price Amount
1 Design system Tokens, components, documentation 1 480,000,000 480,000,000 تومان
2 Monthly support Two dedicated days 3 25,000,000 75,000,000 تومان
3 Motion workshop Half a day, whole team 2 18,000,000 36,000,000 تومان
Subtotal 591,000,000 تومان
VAT (9%) 53,190,000 تومان
Total due 644,190,000 تومان

Payable by the due date; afterwards a late fee of 2% per month applies.

Nabu Studio · hello@nabu.studio · Thank you for building with us. Nabu Studio

A quiet internal draft

The same block with status draft, no tax steps, no note — internal hours before they become a real invoice. decimals drops the fraction digits.

Nabu Studio

Invoice

Invoice no.
DRAFT-31
Draft
From

Nabu Studio

Billed to

Internal · design review

Invoice DRAFT-31
Item Qty Unit price Amount
1 Accessibility audit 6 9,000,000 54,000,000
2 RTL sweep 4 7,500,000 30,000,000
Subtotal 84,000,000
Total due 84,000,000
Not billable — for the Tuesday review only. Nabu Studio

Print either one straight from the browser — the block ships its own print stylesheet.

Important props

Important props
Prop Type Default What it does
lines array [] Each row: title, description, quantity, unitPrice (or a direct amount); the totals are computed from them.
extraTotals array [] Steps between the subtotal and the total: ['label' => …, 'amount' => …] or ['percent' => 0.09] of the subtotal.
status / statusLabel string null paid | unpaid | overdue | draft; the badge takes the right colour and words itself.
from / to array [] Both sides: ['name' => …, 'lines' => [address, email, tax id…]].
currency / decimals string / int null / 0 The currency (free text like “تومان”) and the totals’ fraction digits.
note / footer string null The note at the foot and the closing footer line.

Snippet

<x-nx::invoice number="INV-1404-082" status="unpaid" currency="تومان"
    :from="['name' => 'استودیو نابو', 'lines' => ['استانبول، ترکیه', 'hello@nabu.studio']]"
    :to="['name' => 'شرکت آدم', 'lines' => ['accounts@acme.com']]"
    :lines="[
        ['title' => 'سیستم طراحی', 'quantity' => 1, 'unitPrice' => 480000000],
        ['title' => 'پشتیبانی ماهانه', 'quantity' => 3, 'unitPrice' => 25000000],
    ]"
    :extra-totals="[['label' => 'مالیات بر ارزش افزوده (۹٪)', 'percent' => 0.09]]" />