Import
import { UsageCount } from '@contentful/f36-components';// orimport { UsageCount } from '@contentful/f36-usage-count';
Examples
Default UsageCount example of periodic variant.
function UsageCountExample() { return ( <UsageCount variant="periodic" value={150} valueUnit="GB" periodType="year" /> ); }
UsageCount example of consumption variant.
function UsageCountConsumptionExample() { return ( <UsageCount variant="consumption" value={150} valueDescription="consumption units per year" /> ); }
UsageCount example of entitlement variant.
function UsageCountExample() { return ( <UsageCount variant="entitlement" value={150} valueUnit="GB" quota={200} includedLabel="included" /> ); }
Props (API reference)
Open in StorybookName | Type | Default |
|---|---|---|
| variant required | "consumption" "periodic" "entitlement" | |
| className | string CSS class to be appended to the root element | |
| includedLabel | string | |
| periodType | "month" "year" | |
| quota | string number | |
| testId | string A [data-test-id] attribute used for testing purposes | |
| value | string number | |
| valueDescription | string | |
| valueUnit | string |