dolfindevelopers

Bill history

ComponentPayablesSDK + UI

A bill's audit history, newest first, with the states it moved between and who moved it, 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

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/ap-bill-timeline

Also installs: button, base-states, base-status-badge, base-timeline, ui-ap-bill-timeline.

Usage

screen.tsx
import { BillTimeline } from "@/components/dolfin/ap/bill-timeline";

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

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
billIdstringFetches the bill's history. Leave it out and pass `entries` to draw your own.
entriesreadonly BillTimelineEntry[]The history to draw, newest first. Passing it (or `loading` / `error`) fetches nothing.
loadingboolean
errorError
onRetry() => void
pagenumber1-based page shown. The pager shows when there is a previous or next page.
hasNextPageboolean
onPageChange(page: number) => void
pageSizenumberEntries per page when fetching; default 10.
emptyStatestring | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re…Replaces the default "Nothing has happened to this bill yet." state.
classNamestring

Customisation

Without editing the source, you can change:

Class names
className
Messages
ap.billap.bills.statesbase.dataTablebase.statescore.errors

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.

useBillTimelineuseDolfinLocaleuseMessages

Files

Written to your app by the install command:

  • components/dolfin/ap/bill-timeline.tsx 142 lines