@get-asset/react

AssetOperatingExpensesCard

Styled card showing the largest expense categories for a period with proportional bars and amounts. Period defaults to the AssetProvider's year/month. Pass insights(shown in the preview) to render the AI insights panel to the left of the categories — it answers the listed questions from the profit & loss insights endpoint automatically.

Preview

Operating Expenses

2026
Trends are generated and may include inaccuracies.
$68,100.00
Total Expense
Payroll$32,000.00
Rent$18,000.00
Software$9,500.00
Marketing$6,200.00
Travel$2,400.00

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
yearnumberFiscal year to report on. Falls back to the AssetProvider's year.
monthnumber | nullMonth (1-12). When set the card scopes categories to that single month; null explicitly forces a whole-year range. Falls back to the AssetProvider's month (default: no month).
limitnumber5Max number of categories to display.
categoriesOperatingExpenseCategoryOverride[]Override fetched data. Each entry: { name, amount }. Skips the API call.
state"loading" | "error" | "empty"Force a specific state for testing.
insightsboolean | { questions?, ask? }Show the AI insights panel to the left of the categories (12-col grid: insights 4, categories 8). Pass `true` and it fetches answers from the profit & loss insights endpoint automatically for the period on screen. Alongside the starter questions, an “Ask something else” input lets people type their own — same endpoint, 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 categories 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 `categories` 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

Operating Expenses

2026
Total Expense
Success

Operating Expenses

2026
$68,100.00
Total Expense
Payroll$32,000.00
Rent$18,000.00
Software$9,500.00
Marketing$6,200.00
Travel$2,400.00
EmptyNo categorized expenses for the year.

Operating Expenses

2026
Total Expense
Connect your financial accounts to see your operating expenses here.
Error

Operating Expenses

2026
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`.

Operating Expenses

2026
Unlock your operating expenses

See where your operating spend goes, category by category, on a paid plan.