Import
import { UsageCount } from '@contentful/f36-components';// orimport { UsageCount } from '@contentful/f36-usage-count';
Examples
Default UsageCount example of periodic
variant.
function UsageCountExample() {return (<UsageCountvariant="periodic"value={150}valueUnit="GB"periodType="year"/>);}
UsageCount example of consumption
variant.
function UsageCountConsumptionExample() {return (<UsageCountvariant="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} />);}
Props (API reference)
Open in StorybookName | Type | Default |
---|---|---|
variant required | "consumption" "periodic" "entitlement" | |
className | string CSS class to be appended to the root element | |
css | string number false true ComponentSelector Keyframes SerializedStyles ArrayInterpolation<undefined> ObjectInterpolation<undefined> (theme: any) => Interpolation<undefined> | |
periodType | "month" "year" | |
quota | number | |
testId | string A [data-test-id] attribute used for testing purposes | |
value | string number | |
valueDescription | string | |
valueUnit | string |