@get-asset/react

AssetExpensesCard

Drop-in styled card for the period's expenses and the change versus the prior period. A decrease reads as a positive tone; an increase as negative. Period defaults to the AssetProvider's year/month.

Preview

Expenses

2026
$78,000.00
9%
from prior period

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 shows that month vs. the previous month; null explicitly forces a whole-year range. Falls back to the AssetProvider's month (default: no month).
expensesnumberOverride fetched expenses. Skips the API call.
previousExpensesnumberOverride fetched prior-period expenses.
state"loading" | "error"Force a specific state for testing.
lockedbooleanGate the report for a viewer who isn't entitled to it. Activates the SDK's Locked state: the metric renders blurred and inert as a teaser behind a lock and the upgrade CTA. No live fetch runs while locked — the teaser shows built-in placeholder data (an `expenses` 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

Expenses

2026
from prior period
SuccessYear-over-year decrease (positive tone).

Expenses

2026
$78,000.00
9%
from prior period
Error

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

Expenses

2026
Unlock your expenses

See your expenses and how they're trending against last period on a paid plan.