Receipt detail page
One receipt: back link, header with View file and Read again, notices, the file beside what was read and its card transaction (match it by hand while unmatched), then its lines. ReactNode props for header actions, extra fields, extra sections and an aside.
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
Works with Dolfin’s SDK context, 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/expenses-receipt-detail-pageAlso installs: expenses-receipt-detail, base-page, ui-expenses-receipt-detail-page.
Usage
import { ReceiptDetailPage } from "@/components/dolfin/expenses/receipt-detail-page";
// A whole screen: mount it on a route, inside your <DolfinProvider>.
export default function Route({ params }: { params: { receiptId: string } }) {
return <ReceiptDetailPage receiptId={params.receiptId} />;
}Renders inside DolfinProvider (set it up once). It renders the data you pass as props.
API reference
| Prop | Type | Description |
|---|---|---|
receiptId required | string | |
aside | string | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re… | A column beside the receipt. |
getExpenseRoute | (expenseId: string) => DolfinRoute | null | Where "Open the expense" goes; the expense page by default. Return null to hide it. |
hideBackLink | boolean | Hide the "Back to receipts" link. |
className | string | |
sections | string | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re… | Extra cards after the lines (e.g. the expense's accounting sync). |
fields | string | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re… | Extra fields in "What we read". |
headerActions | string | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re… | Buttons after View file and Read again. |
Customisation
Without editing the source, you can change:
- Class names
className- Messages
expenses.receipts.detail
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.
useMessagesFiles
Written to your app by the install command:
components/dolfin/expenses/receipt-detail-page.tsx56 lines