Payables home
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
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-homeAlso installs: button, base-theme, base-page, base-money, base-states, ap-stats-cards, ui-ap-home.
Usage
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
| Prop | Type | Description |
|---|---|---|
headerActions | string | 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. |
onboarding | string | 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. |
aside | string | 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. |
emptyState | string | 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). |
hide | readonly ApHomeSection[] | Sections to hide, e.g. `["scheduledPayments"]` when payments run elsewhere. |
onAskAgent | (prompt: string, tile: ApStatTileKey) => void | Adds an Ask agent button to each stat tile. |
title | string | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re… | Overrides the header copy. |
eyebrow | 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
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.
useApBillsByStateuseApStatsuseDolfinLocaleuseMessagesFiles
Written to your app by the install command:
components/dolfin/ap/ap-home.tsx81 linescomponents/dolfin/ap/ap-home-panels.tsx248 lines