Bills table
Bills newest first with supplier, invoice number and date, due date with overdue emphasis, amount, outstanding, confidence, state and an optional match column. Row actions for the bill's state (approve, reject, reopen, retry extraction) behind confirmations, disabled with the reason for roles that can't take them. Configurable columns, state labels and tones, and row actions, rows that link to the bill, cursor pagination and loading, empty and error states.
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/ap-bills-tableAlso installs: button, dialog, dropdown-menu, input, base-theme, base-data-table, base-entity-cell, base-info-hint, base-money, base-status-badge, base-states, ui-ap-bills-table.
Usage
import { ApBillsTable } from "@/components/dolfin/ap/bills-table";
// Place it anywhere inside your <DolfinProvider>.
<ApBillsTable />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 | BillListFilters | Filters for the list this table loads itself. |
bills | readonly { id?: string; organisationId?: string; state?: components["schemas"]["BillState"]; source?: components["schemas"]["BillSource"]; e… | The bills to show. Passing them (or `loading` / `error`) fetches nothing; rows still link to the bill. |
loading | boolean | |
error | Error | |
onRetry | () => void | |
page | number | 1-based page shown; the pager shows with `onPageChange`. |
hasNextPage | boolean | |
onPageChange | (page: number) => void | |
filtered | boolean | With your bills: the list is filtered, so the empty state says "No bills match". |
pageSize | number | Bills per page when the table fetches. |
columns | BillColumn[] | ((defaults: BillColumn[]) => BillColumn[]) | Replace or extend the default columns. |
columnOrder | readonly string[] | |
columnVisibility | Readonly<Partial<Record<string, boolean>>> | |
stateLabels | Partial<Record<"Created" | "Extracting" | "PendingReview" | "NeedsApproval" | "Approved" | "Rejected" | "Scheduled" | "Paid" | "ExtractionFa… | Your words per bill state in the state column, e.g. `{ NeedsApproval: "To approve" }`. |
stateTone | Partial<Record<"Created" | "Extracting" | "PendingReview" | "NeedsApproval" | "Approved" | "Rejected" | "Scheduled" | "Paid" | "ExtractionFa… | Your badge tone per bill state in the state column, e.g. `{ Scheduled: "warning" }`. |
stateCell | BillStateCellOptions | The state column's badge: `{ variant: "dot", flags: ["overdue"], badgeClassName, className }`. |
rowActions | BillRowAction[] | ((defaults: BillRowAction[]) => BillRowAction[]) | The row menu. Fetching, the defaults are Open bill, the review actions the bill's state offers (submit, approve, reject, reopen, retry extraction; disabled with the reason for roles that can't) and Open bill match. With your bills there are none: the menu shows only the actions you pass. |
pendingId | string | With your bills: the bill whose action is running; its row menu shows busy. |
onRowClick | (bill: BillListItem) => void | Called when a row is clicked; given, it replaces the row's link. |
getRowRoute | (bill: BillListItem) => DolfinRoute | null | Where a row links to when there is no `onRowClick`; the bill by default (`null` for a plain row). |
onNavigate | (route: DolfinRoute) => void | Overrides the provider's navigation for row actions. |
sort | DataTableSort | |
onSortChange | (sort: DataTableSort | null) => void | |
onCountChange | (count: number) => void | Reports the number of bills on the current page. |
emptyState | string | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re… | Replaces the default empty state. |
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; organisationId?: string; state?: components["schemas"]["BillState"]; source?: components["schemas"]["BillSource"]; eInv… | 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
ap.bill.actionsap.bill.approvalap.billsap.dueInap.dueTodayap.noValueap.overdueap.statesap.tablebase.infoHint.moreAbout
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.
Files
Written to your app by the install command:
components/dolfin/ap/bills-table.tsx358 linescomponents/dolfin/ap/bills-table-cells.tsx244 linescomponents/dolfin/ap/bills-table-actions.tsx245 lines