dolfindevelopers

Merchant detail

ComponentExpensesSDK + UI

One merchant: name, spend per currency, expense count, category and first seen; how the card networks spell it (as printed, cleaned, recognised automatically or first spelling, first seen); and a Spend here section with the expenses made there (and a link to the filtered expenses list). Loading, not found and error states. Fetches by merchant id (the merchant and its spend in parallel), or shows the merchant you pass and fetches nothing. Header actions, the Spend here body and extra sections are plain props; takes the spelling columns.

Component: A piece you place inside your own screens: a table, a form, a card or a dialog. You decide the layout around it. Pages vs components

Choose your integration

Ready to connect to Dolfin. Loads data through SDK hooks, 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-merchant-detail

Also installs: badge, expenses-merchants-table, expenses-table, base-data-table, base-info-hint, base-page, base-states, base-theme, ui-expenses-merchant-detail, ui-base-data-table.

Usage

screen.tsx
import { MerchantDetail } from "@/components/dolfin/expenses/merchant-detail";

// Place it anywhere inside your <DolfinProvider>.
<MerchantDetail />

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

PropTypeDescription
merchantIdstringFetches the merchant, and the spend made there for the "Spend here" section.
merchant{ aliases?: components["schemas"]["MerchantAliasResponse"][]; id?: string; displayName?: null | string; logoUrl?: null | string; mcc?: null …Your merchant. Passing `merchant`, `loading` or `error` means nothing is fetched; `null` reads as not found.
loadingboolean
errorError
onRetry() => voidShows "Try again" in the error state.
expensesstring | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re…The "Spend here" section body. By id it defaults to the expenses made there; with your own merchant there is no default. `null` drops the section.
headerActionsstring | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re…Buttons in the header.
sectionsstring | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re…Extra sections after the spellings.
aliasColumnsMerchantAliasColumnsProp
beforestring | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re…Rendered above the header in every state (e.g. a back link).
classNamestring

Customisation

Without editing the source, you can change:

Class names
className
Messages
base.infoHint.moreAboutexpenses.merchants

Or edit the installed file directly: it is your code. See theming for colours and fonts.

Hooks

The SDK hooks this component uses. Use them directly from @dolfinai/react to build your own version.

useDolfinLocaleuseExpensesuseMerchantuseMessages

Files

Written to your app by the install command:

  • components/dolfin/expenses/merchant-detail.tsx 284 lines