dolfindevelopers

Card transaction detail

ComponentExpensesSDK + UI

The Card transaction card as the network reported it: card, descriptor, status, category code, when and where it occurred, the authorised and settled amounts and, for a foreign purchase, what the card was billed. Pass the transaction you already hold (e.g. from an expense) or an id to read it, with loading, not found and error states. ReactNode props for the Spent by row, extra fields and header actions; also exports the field list alone. Pass transaction (with loading and error) to render it without a request.

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-card-transaction-detail

Also installs: card, expenses-status, base-info-hint, base-money, base-states, base-theme, ui-expenses-card-transaction-detail.

Usage

screen.tsx
import { CardTransactionDetail } from "@/components/dolfin/expenses/card-transaction-detail";

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

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
transactionIdstringRead the transaction by id.
transaction{ id?: string; cardConnectionId?: string; expenseId?: null | string; status?: components["schemas"]["CardTransactionStatus"]; descriptor?: n…The transaction you already hold, e.g. `expense.cardTransaction`: rendered as given, nothing is fetched.
loadingboolean
errorError
onRetry() => void
showExpenseLinkbooleanAdds a link to the expense the transaction became (off by default: on the expense page it is the page itself).
headerActionsstring | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re…Beside the card title.
classNamestring
cardsreadonly { id?: string; organisationId?: string; provider?: components["schemas"]["CardProvider"]; network?: null | string; last4?: null | s…Cards you already hold, to name the card row without fetching.
spenderstring | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re…The Spent by row's value (e.g. a member picker); the row is left out without it.
cardLabelstring | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re…The card row. Defaults to the card's name and network from the organisation's cards.
spenderLabelstring | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re…Replaces the Spent by row's label, e.g. to add an explanation beside it.
extraFieldsstring | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re…More rows: `<dt>` and `<dd>` pairs.

Customisation

Without editing the source, you can change:

Class names
className
Messages
expenses.cardTransactions

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.

useCardTransactionuseCardTransactionCardsuseDolfinLocaleuseMessages

Files

Written to your app by the install command:

  • components/dolfin/expenses/card-transaction-detail.tsx 292 lines