Card transactions list page
Everything received from the card network: Expenses header, merchant search and date range, and the card transactions table with pagination; each row opens the expense it became. ReactNode props for header actions, the filters, the empty state and an aside; takes the table's columns and rowActions, and filters with onFiltersChange that round-trip through the URL (cardTransactionFiltersFromSearch, cardTransactionFiltersToSearch).
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
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-list-pageAlso installs: expenses-card-transactions-filters, expenses-card-transactions-table, base-page, ui-expenses-card-transactions-list-page.
Usage
import { CardTransactionsListPage } from "@/components/dolfin/expenses/card-transactions-list-page";
// A whole screen: mount it on a route, inside your <DolfinProvider>.
export default function Route() {
return <CardTransactionsListPage />;
}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, e.g. from the URL with `cardTransactionFiltersFromSearch`. |
onFiltersChange | (filters: CardTransactionListFilters) => void | Called when the filters the list is read with change (the search once typing pauses), e.g. to write them to the URL with `cardTransactionFiltersToSearch`. Writing them back into `filters` does not reset anything. |
pageSize | number | |
headerActions | string | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re… | Buttons in the page header (e.g. a link to the cards screen). |
filterBar | string | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re… | Replaces the search and date filters (pass `null` to hide them). |
filterActions | string | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re… | Extra controls after the default filters. |
emptyState | string | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re… | Replaces both empty states. |
aside | string | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re… | A column beside the list. |
className | string | |
columns | CardTransactionColumnsProp | |
columnOrder | readonly string[] | |
columnVisibility | Readonly<Record<string, boolean>> | |
rowActions | CardTransactionRowActionsProp | |
variant | DataTableVariant | |
onRowClick | (transaction: CardTransaction) => void | Called when a row is clicked; given, it replaces the row's link. |
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). |
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 page uses. Use them directly from @dolfinai/react to build your own version.
useCardTransactionCardsuseCardTransactionsuseMessagesFiles
Written to your app by the install command:
components/dolfin/expenses/card-transactions-list-page.tsx125 lines