Create recurring invoice page
Set up a recurring invoice: the schedule form with New customer and New product dialogs, optionally prefilled from contract terms (with the reading's confidence and missing fields) or from a contract dropped on the page. Opens the schedule once created. Takes header actions, banners and extra form cards as plain nodes.
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-create-recurring-invoice-pageAlso installs: button, base-theme, base-page, base-states, ar-schedule-form, ar-schedule-contract, ar-create-customer-dialog, ar-create-product-dialog, ui-ar-create-recurring-invoice-page.
Usage
import { ArCreateRecurringInvoicePage } from "@/components/dolfin/ar/create-recurring-invoice-page";
// A whole screen: mount it on a route, inside your <DolfinProvider>.
export default function Route() {
return <ArCreateRecurringInvoicePage />;
}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 |
|---|---|---|
contractTerms | { customerName?: null | string; customerEmail?: null | string; currency?: null | string; memo?: null | string; startDate?: null | string; ca… | Terms read off a contract (e.g. from `ArRecurringInvoicesListPage`'s `onContractRead`): the form starts prefilled. |
allowContractUpload | boolean | Offer "Start from a contract" on this page when no terms were passed. Default true. |
onCreated | (schedule: Schedule) => void | Called with the new schedule before the page moves to it. |
onNavigate | (route: DolfinRoute) => void | Replaces the provider's navigation (back, cancel, after creating). |
headerActions | string | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re… | Buttons beside the title. |
banners | string | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re… | Above the form: notices such as delivery or accounting status. |
fields | string | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re… | Extra cards after the line items. |
hideCreateCustomer | boolean | Hides "New customer" and "New product" in the pickers. |
hideCreateProduct | boolean | |
title | 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.schedules
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.
useCanManageSchedulesuseDolfinNavigateuseMessagesFiles
Written to your app by the install command:
components/dolfin/ar/create-recurring-invoice-page.tsx116 lines