dolfindevelopers

Bill attachments

ComponentPayablesSDK + UI

Files that came with a bill (an e-invoice's supporting documents), each downloaded through a fresh signed link, with loading 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-attachments-card

Also installs: button, base-states, ui-ap-bill-attachments-card.

Usage

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

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

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 attachments. Leave it out and pass `attachments` to draw your own.
attachmentsreadonly { id: string; fileName: string; mimeType?: null | string; size?: number | string; description?: null | string; downloadUrl?: null |…The files to list. Passing it (or `loading` / `error`) fetches nothing.
loadingboolean
errorError
onRetry() => void
onDownload(attachment: BillAttachment) => void | Promise<void>Shows a Download button per file. Wired for you when the card fetches.
emptyStatestring | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re…Shown when the bill has no attachments. By default the card renders nothing then.
classNamestring

Customisation

Without editing the source, you can change:

Class names
className
Messages
ap.bill.attachmentsbase.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.

useBillAttachmentsuseMessagesuseNotify

Files

Written to your app by the install command:

  • components/dolfin/ap/bill-attachments-card.tsx 96 lines