Bill detail page
One bill (exported as BillDetailPage, and as ApBillDetailPage beside ApBillsListPage): its document beside its summary, approval, lines, match, breakdown, payments, validation and history, with the actions its state allows. Accepts your own header actions, banners, aside cards, the match panel, extra actions and the create-supplier dialog (defaults to the supplier dialog prefilled from the bill).
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
Ready to connect to Dolfin. Loads data through SDK hooks, with appearance and behaviour you can customise. Requires DolfinProvider.
Installation
Needs the Dolfin registry token. The CLI copies the source into your app.
bunx --bun shadcn@4.23.0 add @dolfin/ap-bill-detail-pageAlso installs: base-states, ap-bill-header, ap-bill-summary, ap-bill-lines, ap-bill-match-panel, ap-bill-validation-card, ap-bill-attachments-card, ap-bill-payments-card, ap-bill-timeline, ap-bill-document-viewer, ap-submit-review-dialog, ap-create-supplier-dialog, ui-ap-bill-detail-page.
Usage
import { ApBillDetailPage } from "@/components/dolfin/ap/bill-detail-page";
// A whole screen: mount it on a route, inside your <DolfinProvider>.
export default function Route({ params }: { params: { billId: string } }) {
return <ApBillDetailPage billId={params.billId} />;
}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
| Prop | Type | Description |
|---|---|---|
billId required | string | |
headerActions | string | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re… | Buttons in the bar above the bill, after the built-in ones. |
banners | string | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re… | Above the bill's details: notices such as e-invoice faults. |
aside | string | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re… | Cards after the payments (for example paying by bank, accounting sync, a bookkeeping card). |
matchPanel | string | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re… | The three-way match panel. Defaults to `BillMatchPanel` (lines, variances, resolve actions) when the bill has a match; `null` hides it. |
actions | string | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re… | More primary actions, shown with approve and reject (for example paying the bill). |
paymentActions | string | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re… | Buttons in the payments card header (for example recording a payment). |
hideCreateSupplier | boolean | Hides "Create supplier" on a bill naming a supplier not on file (it opens `ApCreateSupplierDialog`). |
errorState | string | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re… | Replaces the not-found and error state (`null` shows nothing). |
onNavigate | (route: DolfinRoute) => void | Replaces the provider's navigation for every link on the page. |
settingsLink | string | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re… | Where approval rules are managed, in the review dialog (null hides the link). |
hideDocument | boolean | Hides the document pane (for hosts that show the document elsewhere). |
hideMatch | boolean | Hides the header's Match link (for hosts without the match workspace). |
hideWorkspaceLink | boolean | Hides "Open match workspace" in the match panel. |
className | string |
Customisation
Without editing the source, you can change:
- Class names
className- Messages
ap.billbase.statescore.errors
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.
useBilluseBillActionsuseDolfinHasRouteuseMessagesFiles
Written to your app by the install command:
components/dolfin/ap/bill-detail-page.tsx205 lines