UsageTrend draws one bar per past billing period, oldest first, labelled with the period’s start date and its amount or units. From React 0.11.0.
When to use
- A usage history section of your billing settings.
- Beside
UsageBreakdownto compare this period with earlier ones. - A chart of one feature’s units over time, with
featureCode.
- Light
- Dark
- Minimal
- Neobrutal
- Nozle
- Nozle Dark

Importing UsageTrend
Rendering UsageTrend
Inside aBillingProvider with billingEndpoint, read past periods with useUsage({ period: 'past' }) and pass them in:
app/billing/history/page.tsx
en-US.
Data
periods is a list of CustomerUsageData, one per billing period, as in the usage_periods of Core’s past-usage endpoint. Amounts are in cents; units is a decimal string.
Full example data
Full example data
Live data
useUsage({ period: 'past' }) reads past periods for the signed-in customer through your billingEndpoint; periods sets how many. Its data is the list of periods and passes to periods directly:
GET https://api.nozle.app/core/api/v1/customers/{external_customer_id}/past_usage on your backend with a secret key and pass its usage_periods. It takes periods_count and feature_code.
Examples
Units of one feature
WithfeatureCode, each bar shows that feature’s units in the period instead of the amount, for example “29,800 api_calls”. Periods without the feature show zero.

Loading, empty and error
isLoading shows a loading placeholder, an empty list shows emptyMessage, and error shows the message as an alert.

API reference
CustomerUsageData[] | null
The periods to chart, in any order. Empty or missing shows the empty message.
string
Charts the units of this feature instead of the amount. Bars read “29,800 api_calls”.
boolean
default:false
Shows a loading placeholder.
Error | string | null
Shows the message as an alert. Defaults to
null.string
default:"No past usage yet."
Shown when there are no periods.
Appearance
Theme, variables and element overrides. Defaults to the provider’s. See Appearance.
States
Appearance
Element keys
Element keys
usageTrend (root), usageTrend__bar (each bar).Style them with appearance.elements. See Elements.Related
UsageBreakdown
This period’s units and amounts.
UsageDashboard
Usage against limits.




