dolfindevelopers

Receivables stat tiles

ComponentReceivablesSDK + UI

Outstanding, Overdue and Received in the last 30 days, each with an explanation, multi-currency detail and trend, plus loading, empty and error states. ArStatCard builds custom tiles from the same figures.

Component: A piece you place inside your own screens: a table, a form, a card or a dialog. You decide the layout around it. 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/ar-stats-cards

Also installs: button, skeleton, base-theme, base-money, base-stat-card, base-states, ui-ar-stats-cards, base-info-hint.

Usage

screen.tsx
import { ArStatsCards } from "@/components/dolfin/ar/stats-cards";

// Place it anywhere inside your <DolfinProvider>.
<ArStatsCards />

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
statsArStatsFiguresYour own figures (from `deriveArStats`, or `useArStats`): the tiles then make no request.
loadingboolean
errorErrorWith no figures, the error state; with figures, a note that some failed to load.
onRetry() => void
tilesreadonly ArStatTileKey[]Which built-in tiles to show, in order. Defaults to Outstanding, Overdue, Received.
extraTiles(stats: ArStatsFigures) => ReactNodeCustom tiles after the built-in ones; build them with `ArStatCard` from the same figures.
onAskAgent(prompt: string, tile: ArStatTileKey) => voidShows an Ask agent button on each tile; the prompt is the tile's question for an assistant.
emptyStatestring | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re…Replaces the empty state (no invoices or payments at all). Pass `false` to show the tiles at zero instead.
onSelectTile(tile: ArStatTileKey) => voidMakes the built-in tiles toggles, e.g. to filter the invoices list by the tile picked.
selectedTileArStatTileKeyThe tile shown as picked (`aria-pressed`).
tileClassNamesStatCardClassNamesPer-part classes for every built-in tile (label, value, sub, ...).
classNamestring

Customisation

Without editing the source, you can change:

Class names
className
Messages
ar.homebase.states

Or edit the installed file directly: it is your code. See theming for colours and fonts.

Hooks

The SDK hooks this component uses. Use them directly from @dolfinai/react to build your own version.

useArStatsuseMessages

Files

Written to your app by the install command:

  • components/dolfin/ar/stats-cards.tsx 311 lines