dolfindevelopers

Invoice detail page

PageReceivablesSDK + UI

One invoice: its PDF, email and pay page beside its header, lines, breakdown, payments, key dates and history, with the actions its state allows. Props for header actions, banners, payment-link tools, credit notes, aside cards, e-invoice delivery widgets, messaging history and extra actions. Credit notes are opt-in: add ar-credit-notes-card and pass it as creditNotes.

Page: A complete screen for one route, such as a bill or the invoices list. Mount it on a route in your app; connected SDK pages provide data and actions; standalone UI pages receive them as props. Pages vs components

Choose your integration

Ready to connect to Dolfin. Loads data through SDK hooks, with appearance and behaviour you can customise. Requires DolfinProvider.

Loading preview…

Installation

Needs the Dolfin registry token. The CLI copies the source into your app.

Terminal
bunx --bun shadcn@4.23.0 add @dolfin/ar-invoice-detail-page

Also installs: base-states, ar-invoice-header, ar-invoice-summary, ar-invoice-lines, ar-invoice-payments, ar-invoice-timeline, ar-invoice-pdf-preview, ui-ar-invoice-detail-page.

Usage

route.tsx
import { ArInvoiceDetailPage } from "@/components/dolfin/ar/invoice-detail-page";

// A whole screen: mount it on a route, inside your <DolfinProvider>.
export default function Route({ params }: { params: { invoiceId: string } }) {
  return <ArInvoiceDetailPage invoiceId={params.invoiceId} />;
}

Renders inside DolfinProvider (set it up once). By default it loads its own data through the SDK. Supplied-data examples show how to override that behavior.

API reference

PropTypeDescription
invoiceId requiredstring
headerActionsstring | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re…Buttons in the bar above the invoice, after Edit and Delete (shown on drafts).
bannersstring | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re…Above the invoice's lines: notices such as missing bank details.
paymentsstring | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re…Payment-link tools (card payments, payment links), shown after the payments card.
creditNotesstring | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re…Credit notes raised against the invoice, shown after the payments. The page has no credit notes card of its own: install `@dolfin/ar-credit-notes-card` and pass `creditNotes={<CreditNotesCard invoiceId={id} />}`.
asidestring | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re…Cards after the credit notes (accounting sync, a bookkeeping card).
deliverystring | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re…E-invoice delivery widgets, in the action stack after the send actions.
messagingstring | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re…Messaging history (chat or SMS threads with the customer), after the invoice's history.
actionsstring | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re…More primary actions, with send and issue.
errorStatestring | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re…Replaces the not-found and error state.
onNavigate(route: DolfinRoute) => voidReplaces the provider's navigation for every link on the page.
onDeleted() => voidCalled after a draft is deleted; defaults to the invoices list.
autoOpenSendbooleanOpens the send dialog once on arrival (drafts only), e.g. from the list's Send action.
onAutoOpenedSend() => void
onFix(fix: InvoiceSendFix) => voidWhere a send problem is fixed. Defaults to the invoice's edit page and the customer's page; organisation settings have no default, so that fix shows no button unless this is given.
hidePreviewbooleanHides the preview pane (for hosts that show the PDF elsewhere).
classNamestring

Customisation

Without editing the source, you can change:

Class names
className
Messages
ar.invoice

Or edit the installed file directly: it is your code. See theming for colours and fonts.

Hooks

The SDK hooks this page uses. Use them directly from @dolfinai/react to build your own version.

useDolfinNavigateuseInvoiceuseMessages

Files

Written to your app by the install command:

  • components/dolfin/ar/invoice-detail-page.tsx 117 lines