dolfindevelopers

Expense detail page

PageExpensesSDK + UI

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

Choose your integration

Works with Dolfin’s SDK context, 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/expenses-expense-detail-page

Also installs: base-theme, base-page, base-states, expenses-expense-detail, ui-expenses-expense-detail-page.

Usage

route.tsx
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

PropTypeDescription
expenseId requiredstring
onNavigate(route: DolfinRoute) => voidReplaces the provider's navigation for every link on the page.
backfalse | DolfinRouteWhere "Back to expenses" leads; `false` hides it. Defaults to the expenses list.
onSetUpCard() => voidWhere 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.
headerActionsstring | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re…Buttons after Re-code in the header.
afterPostedstring | 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.
accountPickerFooterstring | 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).
asidestring | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re…Cards after the card transaction.
errorStatestring | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re…Replaces the not-found and error state.
classNamestring

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.tsx 47 lines