dolfindevelopers

Bulk upload products dialog

DialogReceivablesSDK + UI

Create many products from a CSV: drop or pick a file, download a template, see every bad cell before anything is sent and a preview of what will be created, then upload. Files over the API's caps go in parts; partial failures list each refused row by its row in the file and offer the rows not created as a CSV to fix, with a retry for parts that failed in transit.

Dialog: a modal you open from your own screen. You control when it opens with its props. 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/ar-bulk-upload-products-dialog

Also installs: button, dialog, label, table, base-theme, base-money, ui-ar-bulk-upload-products-dialog.

Usage

screen.tsx
import { ArBulkUploadProductsDialog } from "@/components/dolfin/ar/bulk-upload-products-dialog";

// Place it anywhere inside your <DolfinProvider>.
<ArBulkUploadProductsDialog open={open} onOpenChange={handleOpenChange} />

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
open requiredboolean
onOpenChange required(open: boolean) => void
onUploaded(result: ProductUploadResult) => voidAfter an upload created at least one product. The dialog closes on full success.
batchSizenumberRows per request (at most 1000).
previewRowsnumberRows shown in the preview. Defaults to 5.
helpstring | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re…Below the columns help (e.g. a link to the host's own import guide).
titlestring | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re…
descriptionstring | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re…
classNamestring

Customisation

Without editing the source, you can change:

Class names
className
Messages
ar.products

Or edit the installed file directly: it is your code. See theming for colours and fonts.

Hooks

The SDK hooks this dialog uses. Use them directly from @dolfinai/react to build your own version.

useMessagesuseProductBulkUpload

Files

Written to your app by the install command:

  • components/dolfin/ar/bulk-upload-products-dialog.tsx 182 lines
  • components/dolfin/ar/bulk-upload-parts.tsx 80 lines