dolfindevelopers

Supplier form

ComponentPayablesSDK + UI

The supplier fields shared by the create and edit dialogs: name, email, phone, website, payment terms, tax and registration numbers, address with a country picker, and bank details whose fields follow the bank country (UK sort code and account number, IBAN, BIC, routing number), with client-side checks and the API's field errors.

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-form

Also installs: button, input, label, popover, command, base-theme, base-states, ui-ap-supplier-form.

Usage

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

// Place it anywhere inside your <DolfinProvider>.
<SupplierFormFields values={values} onChange={handleChange} />

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
values requiredSupplierFormValue
onChange required(next: SupplierFormValue) => void
errorsReadonly<Record<string, string | undefined>>Messages by field: `name`, `email`, `address.city`, `bankDetails.sortCode`, ...
idPrefixstringPrefix for input ids (`supplier` gives `supplier-name`); keep it unique per page.
autoFocusboolean
inDialogboolean
disabledboolean
hideAddressboolean
hideBankDetailsboolean
countriesreadonly CodeOption[]Your countries and currencies for the pickers. Given, those lists are not fetched.
currenciesreadonly { id?: string; code: string; name: string; symbol: string; decimalPlaces?: number | string; }[]
bankProfilesReadonly<Record<string, { countryCode: string; countryName: string; defaultCurrencies: string[]; accountHolderName: components["schemas"]["B…Your bank profiles by country code. Given, or with your `countries`, no profile is fetched.
childrenstring | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re…Extra fields after the bank details.
classNamestring

Customisation

Without editing the source, you can change:

Class names
className
Messages
ap.suppliers.formbase.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.

useBankCountriesuseBankCountryProfileuseBankCurrenciesuseMessages

Files

Written to your app by the install command:

  • components/dolfin/ap/supplier-form.tsx 192 lines
  • components/dolfin/ap/address-fields.tsx 92 lines
  • components/dolfin/ap/bank-details-fields.tsx 161 lines
  • components/dolfin/ap/country-combobox.tsx 171 lines