Supplier card
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
Ready to connect to Dolfin. Loads data through SDK hooks, with appearance and behaviour you can customise. Requires DolfinProvider.
Installation
Needs the Dolfin registry token. The CLI copies the source into your app.
bunx --bun shadcn@4.23.0 add @dolfin/ap-supplier-cardAlso installs: ui-ap-supplier-card.
Usage
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
| Prop | Type | Description |
|---|---|---|
supplierId | string | Fetches 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". |
loading | boolean | |
error | Error | |
onRetry | () => void | |
onSupplierClick | (supplierId: string) => void | Replaces the link to the supplier page with a button that calls this. |
hideLink | boolean | Show the name only, without a link. |
title | string | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re… | |
footer | string | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re… | Below the details (e.g. a "Change supplier" button). |
className | string |
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.
useMessagesuseSupplierFiles
Written to your app by the install command:
components/dolfin/ap/supplier-card.tsx99 lines