dolfindevelopers

Payables home

PagePayablesSDK + UI

The payables overview page: header with an Upload bill link, the stat tiles, bills awaiting approval, scheduled payments and top suppliers, taking your own an onboarding checklist, header actions and an aside.

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-home

Also installs: button, base-theme, base-page, base-money, base-states, ap-stats-cards, ui-ap-home.

Usage

route.tsx
import { ApHome } from "@/components/dolfin/ap/ap-home";

// A whole screen: mount it on a route, inside your <DolfinProvider>.
export default function Route() {
  return <ApHome />;
}

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…Replaces the Upload bill link on the right of the header.
onboardingstring | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re…Rendered under the header, before the figures: the place for a getting-started checklist (see `useApOnboardingStatus` from `@dolfinai/react/ap`). The SDK renders no checklist of its own.
asidestring | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re…Rendered after the panels, full width: spend charts, accounting status, anything of your own.
emptyStatestring | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re…Replaces the stat tiles' empty state (an organisation with no bills at all).
hidereadonly ApHomeSection[]Sections to hide, e.g. `["scheduledPayments"]` when payments run elsewhere.
onAskAgent(prompt: string, tile: ApStatTileKey) => voidAdds an Ask agent button to each stat tile.
titlestring | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re…Overrides the header copy.
eyebrowstring | 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
ap.homebase.states

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.

useApBillsByStateuseApStatsuseDolfinLocaleuseMessages

Files

Written to your app by the install command:

  • components/dolfin/ap/ap-home.tsx 81 lines
  • components/dolfin/ap/ap-home-panels.tsx 248 lines