@get-asset/react

Cashflow Summary Card

Styled card showing twelve months of cash in (green, upward) and cash out (purple, downward) for a fiscal year, diverging from a central $0 axis, with the monthly net cashflowdrawn as a line on top (green where positive, purple where negative). The header surfaces the year's net cashflow, money in and money out totals. Pass insights(shown in the preview) to render the AI insights panel to the left of the chart — it answers the listed questions from the cash-flow insights endpoint automatically, and an “Ask something else” input lets people type their own question for the same structured answer. The chart covers every calendar month the range on screen overlaps — a whole year gives the familiar twelve — and follows the AssetProvider's range unless dateFrom / dateTo pin it.

Preview

Loading preview…

Required scopes

The access token used by AssetProvider must include this scope for this primitive to fetch data successfully:

  • report:read

API reference

Root props

PropTypeDefaultDescription
dateFromCalendarDateStringInclusive start (YYYY-MM-DD) of a fixed reporting range. Detaches the card from the AssetProvider's shared range entirely; must be paired with dateTo (passing one side alone throws). Use periodDateRange to derive the pair from a month, quarter or year. Omit both to follow the provider's DatePicker-driven range.
dateToCalendarDateStringInclusive end (YYYY-MM-DD) of the fixed reporting range. Must be paired with dateFrom.
monthsCashflowSummaryMonthOverride[]Override fetched data — one entry per month on screen. Each entry: { month, moneyIn, moneyOut } (moneyOut positive). Skips the API call.
scalenumberOverride the +/- bound for the bar chart scale.
state"loading" | "error" | "empty"Force a specific state for testing.
insightsboolean | { questions?, ask? }Show the AI insights panel to the left of the chart. Pass `true` and it fetches answers from the cash-flow insights endpoint automatically for the range on screen. Alongside the starter questions, an “Ask something else” input lets people type their own — it runs through the same endpoint and returns the same structured answer. Optionally override the starter `questions`, or inject `ask` to mock answers in docs / tests (this preview uses it).
lockedbooleanGate the report for a viewer who isn't entitled to it. Activates the SDK's Locked state: the metrics and chart render blurred and inert as a teaser behind a lock and the upgrade CTA; the insights panel is omitted. No live fetch runs while locked — the teaser shows built-in placeholder data (a `months` override still wins).
upsell{ title?, description?, ctaLabel?, onUpgrade? }Customize the locked state's copy and action. `ctaLabel` and `onUpgrade` are the tenant's upgrade wording and handler; `title` / `description` default per report.
classNamestringForwarded to the outer card element.

States

Loading

Loading preview…

Success

Loading preview…

EmptyNo cashflow data for the range.

Loading preview…

Error

Loading preview…

LockedViewer isn't entitled to the report — a built-in placeholder teaser renders blurred behind the upgrade prompt. Pass `upsell` to customize the copy and wire `onUpgrade`.

Loading preview…