Overview
Reference usage
QuotaMeter presents quota usage, limits, reset dates, and unlimited states through Meter.
Usage
The label and a figure such as "72 of 100" sit above the bar, and numbers are formatted for the locale. Pass labelVisible={false} when a heading next to the meter already names it; the label stays the meter's accessible name.
A hard limit stops something when it is reached, so the bar fills in the danger tone. A fair-use guide stops nothing: pass limitKind="soft" and the figure reads "of about", and going past it fills the bar in the warning tone and adds "2,400 over" to the accessible value. Put what going over means in children, under the bar.
data-cinder-quota-state on the root is under, over (usage at or past the limit) or unlimited, and data-cinder-limit-kind is hard or soft.
When to use
- Showing usage against a plan or account limit.
- Showing task completion.
Examples
QuotaMeter
Show finite quota consumption with an accessible value summary.
Props
Name | Type | Default | Description |
|---|---|---|---|
used | number | 0 | Amount used so far. Non-finite and negative values are treated as zero. |
limit | number | 100 | The quota's limit. A non-positive or non-finite limit falls back to 100. |
limitKind | 'hard' | 'soft' | 'hard' | How the limit behaves once usage reaches it. hard stops something, so reaching it fills the
bar in the danger tone. soft is a fair-use guide that never stops anything: the figure reads
"of about", and going past it fills the bar in the warning tone and says how far over it is. |
resetsAt | text | When usage resets. Included in the accessible value text. | |
locale | text | BCP-47 locale used for numbers and the reset date. Defaults to LocaleProvider, then the runtime locale. | |
timeZone | text | 'UTC' | IANA time zone used for the reset date. |
unlimited | boolean | false | Usage has no limit: no track is drawn, and the label row becomes a group that reads the amount used. |
label | text | 'Quota' | What is being measured, such as "Emails sorted". |
labelVisible | boolean | true | Whether to render the label and the figure ("7,940 of about 10,000") above the bar. When false the label is only the meter's accessible name. |
children | snippet | Supporting text under the bar, such as what happens past the limit. |