Invoices list page
The invoices list page: header with a New invoice action (disabled with the reason for roles that can't create invoices), status tabs and filters, and the invoices table, with 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
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/ar-invoices-list-pageAlso installs: button, base-theme, base-info-hint, base-page, ar-invoices-filters, ar-invoices-table, ui-ar-invoices-list-page.
Usage
import { ArInvoicesListPage } from "@/components/dolfin/ar/invoices-list-page";
// A whole screen: mount it on a route, inside your <DolfinProvider>.
export default function Route() {
return <ArInvoicesListPage />;
}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 | InvoiceListFilters | Initial filters, e.g. read from the URL. |
onFiltersChange | (filters: InvoiceListFilters) => void | Called after each filter change, e.g. to write the filters back to the URL. |
newInvoice | false | DolfinRoute | Where New invoice leads; `false` hides it. Defaults to the `ar.invoiceCreate` route. |
onNavigate | (route: DolfinRoute) => void | Overrides the provider's navigation for row actions. |
pageSize | number | |
hideFilters | readonly ArInvoicesFilterControl[] | |
showStateFilter | boolean | Adds the state multi-select beside the status tabs (off by default; the tabs set the state filter). |
columns | InvoiceColumnPreset | InvoiceColumn[] | ((defaults: InvoiceColumn[]) => InvoiceColumn[]) | |
columnOrder | readonly string[] | |
columnVisibility | Readonly<Partial<Record<string, boolean>>> | |
rowActions | InvoiceRowAction[] | ((defaults: InvoiceRowAction[]) => InvoiceRowAction[]) | |
headerActions | string | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re… | Rendered before the New invoice button (or instead of it with `newInvoice={false}`). |
emptyState | string | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re… | Replaces the table's empty state. |
aside | string | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re… | Rendered beside the list on wide pages (e.g. payment settings, accounting sync status, e-invoicing). |
title | string | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re… | |
eyebrow | string | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re… | |
className | string |
Customisation
Without editing the source, you can change:
- Class names
className- Messages
ar.invoices
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.
useInvoiceFiltersuseMessagesusePermissionsFiles
Written to your app by the install command:
components/dolfin/ar/invoices-list-page.tsx109 lines