Merchant detail page
One merchant as a page: Back to merchants link, then the merchant detail (spend, spellings, Spend here). ReactNode props for header actions, the Spend here body, extra sections and an aside; takes the spelling columns.
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-merchant-detail-pageAlso installs: expenses-merchant-detail, base-page, ui-expenses-merchant-detail-page.
Usage
import { MerchantDetailPage } from "@/components/dolfin/expenses/merchant-detail-page";
// A whole screen: mount it on a route, inside your <DolfinProvider>.
export default function Route({ params }: { params: { merchantId: string } }) {
return <MerchantDetailPage merchantId={params.merchantId} />;
}Renders inside DolfinProvider (set it up once). It renders the data you pass as props.
API reference
| Prop | Type | Description |
|---|---|---|
merchantId required | string | |
headerActions | string | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re… | Buttons in the merchant's header. |
expenses | string | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re… | The "Spend here" section body (defaults to the expenses made there); `null` drops the section. |
sections | string | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re… | Extra sections after the spellings. |
aside | string | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re… | A column beside the merchant. |
aliasColumns | MerchantAliasColumnsProp | |
hideBackLink | boolean | Hide the "Back to merchants" link. |
className | string |
Customisation
Without editing the source, you can change:
- Class names
className- Messages
expenses.merchants.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/merchant-detail-page.tsx71 lines