Supplier detail page
One supplier: back link, header with contact line, credit available and Edit, contact, address, bank details (with pay-by-bank confirmation) and record cards, then tabs for the supplier's bills, purchase orders and delivery notes. Accepts your own header actions, extra detail cards, the credit notes tab, more tabs and an aside.
Page: A complete screen for one route, such as a bill or the invoices list. Mount it on a route in your app; connected SDK pages provide data and actions; standalone UI pages receive them as props. 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-detail-pageAlso installs: button, tabs, base-theme, base-page, base-states, base-info-hint, base-status-badge, ap-supplier-details, ap-edit-supplier-dialog, ap-confirm-bank-details-dialog, ap-bills-table, ap-purchase-orders-table, ap-delivery-notes-table, ui-ap-supplier-detail-page.
Usage
import { ApSupplierDetailPage } from "@/components/dolfin/ap/supplier-detail-page";
// A whole screen: mount it on a route, inside your <DolfinProvider>.
export default function Route({ params }: { params: { supplierId: string } }) {
return <ApSupplierDetailPage supplierId={params.supplierId} />;
}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 required | string | |
headerActions | string | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re… | Beside the Edit button. |
details | string | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re… | Extra cards in the details grid (e.g. the default ledger account when accounting is connected). |
creditNotes | string | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re… | The Credit tab's content: the supplier's credit notes and how they were applied. No tab without it. |
tabs | ApSupplierDetailPageTabSlot[] | More tabs after the built-in ones. |
aside | string | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re… | A column beside the supplier on wide pages. |
emptyState | string | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re… | Replaces the not-found state. |
hideTabs | readonly ApSupplierDetailPageTab[] | Built-in tabs to leave out. |
defaultTab | string | |
hideBackLink | boolean | |
onNavigate | (route: DolfinRoute) => void | Overrides the provider's navigation for the tables' row actions. |
className | string |
Customisation
Without editing the source, you can change:
- Class names
className- Messages
ap.suppliersbase.infoHint.moreAboutbase.statescore.errors
Or edit the installed file directly: it is your code. See theming for colours and fonts.
Hooks
The SDK hooks this page uses. Use them directly from @dolfinai/react to build your own version.
useCanManageSuppliersuseDolfinLocaleuseMessagesuseSupplieruseSupplierCreditBalancesFiles
Written to your app by the install command:
components/dolfin/ap/supplier-detail-page.tsx202 lines