Invoice history
An invoice's audit history, newest first, in words, marking what Dolfin did automatically, paged by cursor, with 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/ar-invoice-timelineAlso installs: button, base-states, base-timeline, ui-ar-invoice-timeline.
Usage
import { InvoiceTimeline } from "@/components/dolfin/ar/invoice-timeline";
// Place it anywhere inside your <DolfinProvider>.
<InvoiceTimeline />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 |
|---|---|---|
invoiceId | string | Loads the invoice's history, newest first, paged. |
entries | readonly InvoiceTimelineEntry[] | Your own entries: the history then makes no request. |
loading | boolean | |
error | Error | |
onRetry | () => void | |
page | number | 1-based page number, for your own entries. |
hasNextPage | boolean | |
onPageChange | (page: number) => void | Shows the pager for your own entries. |
pageSize | number | Entries per page when it loads; default 20. |
reminders | boolean | Show the reminders already emailed among the history ("Reminder sent") when it loads; default true. |
emptyState | string | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re… | Replaces the default "Nothing has happened to this invoice yet." state. |
className | string |
Customisation
Without editing the source, you can change:
- Class names
className- Messages
ar.invoice.timelinebase.dataTable
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.
useDolfinLocaleuseInvoiceTimelineuseMessagesFiles
Written to your app by the install command:
components/dolfin/ar/invoice-timeline.tsx77 lines