dolfindevelopers

Receipts list page

PageExpensesSDK + UI

The receipts inbox: Expenses header, a drop zone to upload receipts, the Inbox, No VAT number and All receipts views and the receipts table with pagination. ReactNode props for header actions, the upload area, the empty state and an aside; takes the table's columns, rowActions, and filters with onFiltersChange (a new view reported at once).

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

Also installs: expenses-receipt-upload, expenses-receipts-table, base-page, ui-expenses-receipts-list-page.

Usage

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

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

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
filtersReceiptListFiltersInitial filters: the view (inbox by default). A changed value re-applies, e.g. from the URL.
onFiltersChange(filters: ReceiptListFilters) => voidCalled with the whole set after the filters change (a new view), e.g. to keep them in the URL.
pageSizenumber
headerActionsstring | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re…Buttons in the page header.
emptyStatestring | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re…Replaces the table's empty state in every view.
asidestring | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re…A column beside the list.
uploadstring | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re…Replaces the upload drop zone (pass `null` to hide it, e.g. for a read-only role).
classNamestring
columnsReceiptColumnsProp
columnOrderreadonly string[]
columnVisibilityReadonly<Record<string, boolean>>
rowActionsReceiptRowActionsPropPass `[]` for none.
variantDataTableVariant
onRowClick(receipt: Receipt) => voidCalled when a row is clicked; given, it replaces the row's link.
getRowRoute(receipt: Receipt) => DolfinRoute | nullWhere a row links to when there is no `onRowClick`; the receipt by default (`null` for a plain row).
classNamesDataTableClassNames
pagerbooleanShow 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; organisationId?: string; fileName?: null | string; contentType?: null | string; fileSizeBytes?: number | string; source…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.receipts

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.

useMessagesuseReceiptMutationsuseReceipts

Files

Written to your app by the install command:

  • components/dolfin/expenses/receipts-list-page.tsx 119 lines