dolfindevelopers

Bill header and actions

ComponentPayablesSDK + UI

BillHeader: the bar above a bill (back, edit, e-invoice badge, re-classify, match, refresh). BillActions: the primary actions for the bill's state (submit for review, approve, reject, reopen, retry extraction, void) behind confirmations (the SDK's own ask first; a host onX replaces them and runs at once), disabled with the reason (submitReviewDisabledReason, approveDisabledReason, ...) when the role can't take them.

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

Also installs: button, badge, popover, textarea, base-info-hint, base-states, ap-submit-review-dialog, ui-ap-bill-header.

Usage

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

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

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 (sharing the bill page's cache) and wires Re-classify and Refresh.
bill{ id?: string; organisationId?: string; state?: components["schemas"]["BillState"]; source?: components["schemas"]["BillSource"]; eInvoiceId…Your bill. Passing it (or `loading` or `error`) fetches nothing, and Re-classify and Refresh show only with their callbacks. `null` reads as not found. Given with `billId`, the bill wins.
loadingboolean
errorError
onRetry() => voidShows "Try again" in the error state.
onReclassify() => voidShows Re-classify (lines nobody confirmed) where the bill allows it. By id, yours replaces the SDK's.
onRefresh() => voidRe-reads the bill (shown while it is still being extracted). By id, yours replaces the SDK's.
pendingActionBillHeaderActionThe header action running now: its button shows progress, and the other waits.
childrenstring | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re…Extra buttons on the right (the page's `headerActions` slot).
onNavigate(route: DolfinRoute) => voidReplaces provider navigation for the back, edit and match links.
hideMatchbooleanHides the Match link (for hosts without matching; it also hides when `navigation.href` returns null for it).
classNamestring

Customisation

Without editing the source, you can change:

Class names
className
Messages
ap.billbase.infoHintbase.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.

useBilluseBillActionsuseBillPermissionsuseBillSupplieruseDolfinHasRouteuseMessages

Files

Written to your app by the install command:

  • components/dolfin/ap/bill-header.tsx 214 lines
  • components/dolfin/ap/bill-actions.tsx 275 lines