Expense detail page
One expense, laid out by the decision: header with Approve, Retry post and Re-code; the flag and what to do; the approval policy; where it posted; receipt and details; coding with the lines editor; history and the card transaction. Loading and not-found states, and ReactNode props for header actions, a card after the posted entry (bookkeeping), account picker extras 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-expense-detail-pageAlso installs: base-theme, base-page, base-states, expenses-expense-detail, ui-expenses-expense-detail-page.
Usage
import { ExpenseDetailPage } from "@/components/dolfin/expenses/expense-detail-page";
// A whole screen: mount it on a route, inside your <DolfinProvider>.
export default function Route({ params }: { params: { expenseId: string } }) {
return <ExpenseDetailPage expenseId={params.expenseId} />;
}Renders inside DolfinProvider (set it up once). It renders the data you pass as props.
API reference
| Prop | Type | Description |
|---|---|---|
expenseId required | string | |
onNavigate | (route: DolfinRoute) => void | Replaces the provider's navigation for every link on the page. |
back | false | DolfinRoute | Where "Back to expenses" leads; `false` hides it. Defaults to the expenses list. |
onSetUpCard | () => void | Where a card's accounts are set up, offered when an expense is flagged for a missing accounting setup. Card connections live in the host, so the button shows only with this. |
headerActions | string | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re… | Buttons after Re-code in the header. |
afterPosted | string | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re… | After the posted entry: a bookkeeping card or accounting sync status. |
accountPickerFooter | string | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re… | Extra entries at the end of the account pickers (e.g. "Create an account" opening the host's dialog). |
aside | string | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re… | Cards after the card transaction. |
errorState | string | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re… | Replaces the not-found and error state. |
className | string |
Customisation
Without editing the source, you can change:
- Class names
className
Or edit the installed file directly: it is your code. See theming for colours and fonts.
Files
Written to your app by the install command:
components/dolfin/expenses/expense-detail-page.tsx47 lines