Xzero UI
Pro library

Invoice studioPro

An editable invoice with live totals and a clear save flow.

$ pnpm dlx shadcn@4.23.0 add @xzero-ui-pro/invoice-studio
Live · keyboard ready

Use this as a starting point for creating an invoice. Persist line items and totals through your own service.

When to use

When not to use

Installation

Register both Xzero UI namespaces in your project's components.json:

{
  "registries": {
    "@xzero-ui": "https://mcp.xzero.co.uk/r/{name}.json",
    "@xzero-ui-pro": "https://mcp.xzero.co.uk/r/pro/{name}.json"
  }
}
npx shadcn@4.23.0 add @xzero-ui-pro/invoice-studio

Install xzero-foundation once, and import @/components/xzero/foundation.css in your app root. No Xzero token is used by this snapshot. For sample portraits, photos, fonts, or logos, download https://mcp.xzero.co.uk/install-assets.mjs and run node xzero-install-assets.mjs <receiving-project>.

Usage

import { InvoiceStudio, type InvoiceLine } from "@/components/xzero/blocks/invoice-studio/invoice-studio";

export function NewInvoice() {
  async function save(lines: InvoiceLine[]) {
    await fetch("/api/invoices/draft", { method: "POST", body: JSON.stringify({ lines }) });
  }
  return <InvoiceStudio onSave={save} />;
}

API reference

InvoiceStudio

An editable invoice with line items, live subtotal and total, and a save draft action. Client details and starting lines are sample data.

PropTypeDefaultDescription
onSave(lines: InvoiceLine[]) => void | Promise<void>–Called with parsed lines when every line has a description. Awaited; a thrown error shows a save error.

InvoiceLine

Type passed to onSave.

PropTypeDefaultDescription
description (required)string–Line description.
quantity (required)number–Quantity, clamped to zero or more.
rate (required)number–Unit rate in USD.

Accessibility

Motion

Responsive behavior

Performance

Notes for AI

Guidance for AI tools

Blocks are complete, self-contained screens with sample data. Replace the sample data and connect the callbacks described above. Follow the declared prop types and do not invent props. Keep keyboard access, reduced motion support, and both light and dark themes intact when adapting it.

Full library index: https://ui.xzero.co.uk/llms.txt

Browse all components