dolfindevelopers

Receipts table

ComponentExpensesSDK + UI

Uploaded receipts by view (Inbox, No VAT number, All receipts): merchant with source and file name, date, the supplier VAT number (flagged when missing), status, VAT and total. Cursor pagination, rows that open the receipt, a Read again row action on unreadable receipts, and a list that re-reads itself while receipts are being read or matched. Takes columns, rowActions and initial filters (view). Pass receipts (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

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-table

Also installs: tabs, expenses-receipt-parts, base-data-table, base-entity-cell, base-money, base-states, base-theme, ui-expenses-receipts-table.

Usage

screen.tsx
import { ReceiptsTable } from "@/components/dolfin/expenses/receipts-table";

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

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.
pageSizenumber
onViewChange(view: ReceiptListView) => void
hideViewTabsbooleanHide the view tabs (a list fixed to one view).
toolbarActionsstring | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re…Extra controls beside the view tabs.
receiptsreadonly { id?: string; organisationId?: string; fileName?: null | string; contentType?: null | string; fileSizeBytes?: number | string; sou…Receipts you already hold: rendered as given, without view tabs, and nothing is fetched.
loadingboolean
errorError
onRetry() => void
pagenumber1-based page, for the pager in data mode.
hasNextPageboolean
onPageChange(page: number) => void
viewReceiptListViewWhich view's empty state to show in data mode. Defaults to "all".
onReadAgain(receipt: Receipt) => voidShows "Read again" on unreadable receipts. Wired to the SDK when the table reads its own list.
pendingIdstringThe receipt an action (Read again) is running for: its row waits.
columnsReceiptColumnsProp
columnOrderreadonly string[]
columnVisibilityReadonly<Record<string, boolean>>
rowActionsReceiptRowActionsPropPass `[]` for none.
getRowRoute(receipt: Receipt) => DolfinRoute | nullWhere a row links to when there is no `onRowClick`; the receipt by default (`null` for a plain row).
onRowClick(receipt: Receipt) => voidCalled when a row is clicked; given, it replaces the row's link.
emptyStatestring | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re…Replaces the default empty state of every view.
classNamestring
variantDataTableVariant
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 component uses. Use them directly from @dolfinai/react to build your own version.

useDolfinLocaleuseMessagesuseReceiptMutationsuseReceipts

Files

Written to your app by the install command:

  • components/dolfin/expenses/receipts-table.tsx 315 lines
  • components/dolfin/expenses/receipt-table-columns.tsx 198 lines