Card transactions table
The card network feed, newest first: merchant with category and statement descriptor, card, when and where it occurred, status, receipt presence and amount (with the billed figure of a foreign purchase). Cursor pagination, rows that open the expense each transaction became, and separate empty states for no transactions and no matches. Takes columns, rowActions and initial filters. Pass transactions (with loading, error and page props) to render your own rows 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
Ready to connect to Dolfin. Loads data through SDK hooks, 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-card-transactions-tableAlso installs: expenses-card-transaction-parts, expenses-card-transactions-filters, expenses-status, base-data-table, base-states, base-theme, ui-expenses-card-transactions-table.
Usage
import { CardTransactionsTable } from "@/components/dolfin/expenses/card-transactions-table";
// Place it anywhere inside your <DolfinProvider>.
<CardTransactionsTable />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
| Prop | Type | Description |
|---|---|---|
filters | CardTransactionListFilters | Initial filters (search, dates, status, card, category, amounts). A changed value re-applies. |
pageSize | number | |
hideFilters | boolean | Hide the search and date controls (a list fixed by `filters`). |
toolbarActions | string | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re… | Extra controls after the filters. |
transactions | readonly { id?: string; cardConnectionId?: string; expenseId?: null | string; status?: components["schemas"]["CardTransactionStatus"]; descr… | Transactions you already hold: rendered as given, with no filters, and nothing is fetched. |
loading | boolean | |
error | Error | |
onRetry | () => void | |
page | number | 1-based page, for the pager in data mode. |
hasNextPage | boolean | |
onPageChange | (page: number) => void | |
cards | readonly { id?: string; organisationId?: string; provider?: components["schemas"]["CardProvider"]; network?: null | string; last4?: null | s… | Names the card column in data mode; without it the column shows a dash. |
filtered | boolean | Picks the "No transactions match" empty state in data mode. |
columns | CardTransactionColumnsProp | |
columnOrder | readonly string[] | |
columnVisibility | Readonly<Record<string, boolean>> | |
rowActions | CardTransactionRowActionsProp | |
getRowRoute | (transaction: CardTransaction) => DolfinRoute | null | Where a row links to when there is no `onRowClick`; the expense it became by default (`null` for a plain row). |
onRowClick | (transaction: CardTransaction) => void | Called when a row is clicked; given, it replaces the row's link. |
emptyState | string | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re… | Replaces both empty states. |
className | string | |
variant | DataTableVariant | |
classNames | DataTableClassNames | |
pager | boolean | Show the built-in previous / next pager when there is more than one page. Default true; pass false when you draw your own pager from the list's pagination (the table still dims while a page loads). |
onRowHover | (row: { id?: string; cardConnectionId?: string; expenseId?: null | string; status?: components["schemas"]["CardTransactionStatus"]; descript… | Called with the row the pointer moves onto, and with `null` when the pointer leaves the rows (e.g. to highlight the row's point in a chart next to the table). Moving between rows reports the new row without a `null` first. |
Customisation
Without editing the source, you can change:
- Class names
classNameclassNames.frameclassNames.headerclassNames.headerCellclassNames.rowclassNames.cellclassNames.pager- 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.
useCardTransactionCardsuseCardTransactionsuseDolfinLocaleuseMessagesFiles
Written to your app by the install command:
components/dolfin/expenses/card-transactions-table.tsx378 lines