dolfindevelopers

Supplier card

ComponentPayablesSDK + UI

A compact supplier summary for a bill or order: the name linking to the supplier page (or calling your handler), email, phone, address and payment terms, with loading, not-found 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-supplier-card

Also installs: ui-ap-supplier-card.

Usage

screen.tsx
import { ApSupplierCard } from "@/components/dolfin/ap/supplier-card";

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

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
supplierIdstringFetches the supplier. Without an id (and without `supplier`, `loading` or `error`) the card renders nothing.
supplier{ id?: string; organisationId?: string; name: string; email?: null | string; phone?: null | string; website?: null | string; taxNumber?: nul…The supplier to show. Passing it (or `loading` / `error`) fetches nothing; null reads "not found".
loadingboolean
errorError
onRetry() => void
onSupplierClick(supplierId: string) => voidReplaces the link to the supplier page with a button that calls this.
hideLinkbooleanShow the name only, without a link.
titlestring | 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…Below the details (e.g. a "Change supplier" button).
classNamestring

Customisation

Without editing the source, you can change:

Class names
className
Messages
ap.suppliers.cardbase.states.retry

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.

useMessagesuseSupplier

Files

Written to your app by the install command:

  • components/dolfin/ap/supplier-card.tsx 99 lines