dolfindevelopers

Approval policies list page

PagePayablesSDK + UI

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

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-approval-policies-list-page

Also installs: button, base-page, ap-approval-policies-list, ap-approval-policy-form-dialog, ui-ap-approval-policies-list-page.

Usage

route.tsx
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

PropTypeDescription
headerActionsstring | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re…Buttons beside "New policy".
emptyStatestring | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re…Replaces the list's empty state.
asidestring | 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) => voidCalled after a policy is created or saved.
classNamestring
columnsApprovalPolicyColumnsProp
columnOrderreadonly string[]
columnVisibilityReadonly<Record<string, boolean>>
rowActionsApprovalPolicyRowActionsPropPass `[]` for none.
hideFallThroughbooleanHides 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.

useApprovalPoliciesuseMessagesusePermissions

Files

Written to your app by the install command:

  • components/dolfin/ap/approval-policies-list-page.tsx 80 lines