dolfindevelopers

Upload bills dialog

DialogPayablesSDK + UI

A drop zone and file picker for supplier invoices (PDF, PNG, JPG; up to 10 at once) with progress and inline errors, plus the same in a dialog. A single upload opens the new bill. The drop zone takes an idle slot, its own class and a single-file mode; the dialog can stay open after an upload.

Dialog: a modal you open from your own screen. You control when it opens with its props. 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-upload-dialog

Also installs: dialog, progress, base-theme, ui-ap-bill-upload-dialog.

Usage

screen.tsx
import { ApBillUploadDialog } from "@/components/dolfin/ap/bill-upload-dialog";

// Place it anywhere inside your <DolfinProvider>.
<ApBillUploadDialog open={open} onOpenChange={handleOpenChange} />

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
open requiredboolean
onOpenChange required(open: boolean) => void
uploadBillUploadA `useBillUpload` result owned by the caller.
onUploaded(batch: BillUploadBatch) => voidAfter every batch that created at least one bill; the dialog closes first.
openOnSuccessbooleanOpen the new bill after a single-file upload. Defaults to true.
onNavigate(route: DolfinRoute) => void
titlestring | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re…
descriptionstring | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re…
footerstring | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re…Rendered under the drop zone, e.g. the address of a bills inbox.
closeOnSuccessbooleanClose once a batch created a bill. Defaults to true; false keeps it open (e.g. to show a next step).
multiplebooleanPassed to the drop zone: several files at once (default true), its idle content, its class.
dropzoneIdlestring | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re…Replaces what the drop zone shows while idle.
dropzoneClassNamestring
classNamestring

Customisation

Without editing the source, you can change:

Class names
dropzoneClassNameclassName
Messages
ap.bills.uploadcore.errors

Or edit the installed file directly: it is your code. See theming for colours and fonts.

Hooks

The SDK hooks this dialog uses. Use them directly from @dolfinai/react to build your own version.

useBillUploaduseDolfinNavigateuseMessagesuseNotify

Files

Written to your app by the install command:

  • components/dolfin/ap/bill-upload-dialog.tsx 85 lines
  • components/dolfin/ap/bill-upload-dropzone.tsx 156 lines