dolfindevelopers

Expenses list page

PageExpensesSDK + UI

Card spend as a work queue: a natural-language search, then the views (Needs attention, To approve, Missing receipts, All spend) narrowed by whose spend, dates and card, over the expenses table. Filters (view, search, card, whose spend, dates, merchant) that round-trip through the URL with expenseFiltersFromSearch and expenseFiltersToSearch, configurable columns and row actions, and ReactNode props for header actions, the empty state and an aside.

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

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-list-page

Also installs: base-theme, base-page, expenses-filters, expenses-search, expenses-table, ui-expenses-list-page.

Usage

route.tsx
import { ExpensesListPage } from "@/components/dolfin/expenses/expenses-list-page";

// A whole screen: mount it on a route, inside your <DolfinProvider>.
export default function Route() {
  return <ExpensesListPage />;
}

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
headerActionsstring | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re…Buttons on the right of the header (export, link a card).
emptyStatestring | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re…Replaces the table's empty state (and the search's "Nothing matches").
asidestring | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re…Beside the list on wide pages (card connections, spend insights).
filtersExpenseFiltersInitialThe filters: the view, the search, a card ("View spend" from a card), whose spend, dates and a merchant ("See every expense at this merchant"). `expenseFiltersFromSearch` reads them from the URL. A changed value re-applies.
onFiltersChange(next: ExpenseFiltersSnapshot) => voidCalled after each change, the search included, e.g. to write them back to the URL with `expenseFiltersToSearch`, so coming back from an expense lands on the same results.
baseFiltersExpenseListFiltersFilters always applied under the views.
searchQuerystringControls the search on its own (with `onSearchChange`), instead of through `filters.query`.
onSearchChange(query: string) => void
hideSearchbooleanHides the natural-language search.
hideFiltersreadonly ExpensesFilterControl[]
pageSizenumber
columnsColumns
columnOrderreadonly string[]
columnVisibilityReadonly<Partial<Record<string, boolean>>>
rowActionsRowActions
titlestring | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re…
eyebrowstring | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re…
descriptionstring | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re…
classNamestring

Customisation

Without editing the source, you can change:

Class names
className
Messages
expenses.expenses

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.

useExpenseFiltersuseMessages

Files

Written to your app by the install command:

  • components/dolfin/expenses/expenses-list-page.tsx 159 lines