dolfindevelopers

Bill validation

ComponentPayablesSDK + UI

A Run Validation button that checks a bill on demand in a dialog (lines reconcile, totals add up, required details present) and lists the issues as warnings, with running 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-validation-card

Also installs: button, dialog, base-states, base-theme, ui-ap-bill-validation-card.

Usage

screen.tsx
import { BillValidationCard } from "@/components/dolfin/ap/bill-validation-card";

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

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
billIdstringRuns the check against the API each time the dialog opens. Leave it out and pass `onRun` to run your own.
onRun() => voidShows the Run Validation button; called each time it is clicked. The dialog draws `result`.
resultBillValidationResultThe last check's outcome.
loadingbooleanThe check is running.
errorError
onRetry() => void
classNamestring

Customisation

Without editing the source, you can change:

Class names
className
Messages
ap.bill.validationbase.states

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.

useBillValidationuseMessages

Files

Written to your app by the install command:

  • components/dolfin/ap/bill-validation-card.tsx 77 lines