Products list page
The product catalogue page: header with Bulk upload and New product actions, name and type filters, the products table, and the create, CSV upload, edit and delete dialogs, with props for header actions, the empty state, an aside and extra form fields.
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/ar-products-list-pageAlso installs: button, base-theme, base-page, base-info-hint, ar-products-table, ar-create-product-dialog, ar-bulk-upload-products-dialog, ar-edit-product-dialog, ar-product-delete-dialog, ui-ar-products-list-page.
Usage
import { ArProductsListPage } from "@/components/dolfin/ar/products-list-page";
// A whole screen: mount it on a route, inside your <DolfinProvider>.
export default function Route() {
return <ArProductsListPage />;
}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 |
|---|---|---|
filters | ProductListFilters | Initial filters, e.g. read from the URL. |
onFiltersChange | (filters: ProductListFilters) => void | Called once a filter change applies (after the 400ms debounce), e.g. to write it to the URL. |
onCreated | (product: Product) => void | After a product was created from the page. |
onUploaded | (result: ProductUploadResult) => void | After a CSV upload created products. |
readOnly | boolean | Hide the add buttons and the row Edit and Delete actions. |
hideBulkUpload | boolean | Hide the Bulk upload button. |
onNavigate | (route: DolfinRoute) => void | |
pageSize | number | |
columns | ProductColumn[] | ((defaults: ProductColumn[]) => ProductColumn[]) | |
columnOrder | readonly string[] | |
columnVisibility | Readonly<Partial<Record<string, boolean>>> | |
rowActions | ProductRowAction[] | ((defaults: ProductRowAction[]) => ProductRowAction[]) | |
headerActions | string | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re… | Rendered before the Bulk upload and New product buttons. |
emptyState | string | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re… | Replaces the table's empty state. |
aside | string | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re… | Rendered beside the list on wide pages. |
formFields | string | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re… | Extra fields in the create and edit dialogs (e.g. an income account when accounting sync is on). |
title | string | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re… | |
eyebrow | string | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re… | |
description | string | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re… | |
className | string |
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 page uses. Use them directly from @dolfinai/react to build your own version.
useCanManageProductsuseMessagesuseProductsFiles
Written to your app by the install command:
components/dolfin/ar/products-list-page.tsx234 lines