Approval policies list page
Give your users a place to manage bill approval policies. Review rules, create policies and customise the page to fit your product.
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-approval-policies-list-pageAlso installs: button, base-page, ap-approval-policies-list, ap-approval-policy-form-dialog, ui-ap-approval-policies-list-page.
Usage
import { ApprovalPoliciesListPage } from "@/components/dolfin/ap/approval-policies-list-page";
// A whole screen: mount it on a route, inside your <DolfinProvider>.
export default function Route() {
return <ApprovalPoliciesListPage />;
}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 |
|---|---|---|
headerActions | string | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re… | Buttons beside "New policy". |
emptyState | string | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re… | Replaces the list's empty state. |
aside | string | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re… | A column beside the list, e.g. a note on how policies are evaluated. |
onSaved | (policy: ApprovalPolicy) => void | Called after a policy is created or saved. |
className | string | |
columns | ApprovalPolicyColumnsProp | |
columnOrder | readonly string[] | |
columnVisibility | Readonly<Record<string, boolean>> | |
rowActions | ApprovalPolicyRowActionsProp | Pass `[]` for none. |
hideFallThrough | boolean | Hides the note under the table on what happens when no policy matches. |
Customisation
Without editing the source, you can change:
- Class names
className- Messages
ap.approvalPolicies
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.
useApprovalPoliciesuseMessagesusePermissionsFiles
Written to your app by the install command:
components/dolfin/ap/approval-policies-list-page.tsx80 lines