dolfindevelopers

Match line

ComponentPayablesSDK + UI

One bill line of a three-way match, as a workspace row or a compact card: ordered, billed and received quantities, the line's state, variance badges, the variance sentence with Accept, Request credit note and Dispute (or Undo), the engine's suggestions with confidence, and the matched purchase orders and delivery notes. Wired by the callbacks you pass (a button shows only with one; read-only with none), with the line's own progress and error. Exported with its parts so hosts can build their own review layouts.

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

Works with Dolfin’s SDK context, 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-match-line

Also installs: button, base-info-hint, base-status-badge, ui-ap-match-line.

Usage

screen.tsx
import { MatchLine } from "@/components/dolfin/ap/match-line";

// Place it anywhere inside your <DolfinProvider>.
<MatchLine line={line} currency={currency} />

Renders inside DolfinProvider (set it up once). It renders the data you pass as props.

API reference

PropTypeDescription
line requiredMatchLineModel
currency requiredstring
pendingbooleanA command is running on this line: it shows progress and keeps its buttons disabled.
errorstringWhy the last command on this line failed, shown on the line.
variant"card" | "row"`row` is a workspace grid row; `card` is the compact block the bill page's panel stacks.
inDeliveryWindowReadonlySet<string>Purchase orders expected near the invoice date, to tag their suggestions.
onMatchManually(line: MatchLineModel) => voidShows "Match manually" while the line can take one; open your matching dialog here.
footerstring | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re…Extra content at the end of the line (notes, your own actions).
classNamestring
onConfirm(pick: MatchLinePick) => voidConfirm one of the engine's suggestions.
onResolve(action: MatchLineResolveAction) => void
onDispute() => void
onUndo() => voidTake back the decision recorded on the line.
onUnlink(allocationId: string) => voidRemove one of the line's matched documents.
disabledbooleanKeeps the buttons disabled, e.g. while any write on the match runs.

Customisation

Without editing the source, you can change:

Class names
className
Messages
ap.matchbase.infoHint.moreAbout

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.

useDolfinLocaleuseMessages

Files

Written to your app by the install command:

  • components/dolfin/ap/match-line.tsx 170 lines
  • components/dolfin/ap/match-line-parts.tsx 387 lines
  • components/dolfin/ap/match-line-format.tsx 79 lines