Progress
Show how much of a known task is complete.
Show what fills an allowance and how close it is to the limit.
npx shadcn@latest add @silicon-ui/usage-meternpx shadcn@latest add @silicon-ui/usage-meterInstall the dependencies.
npm install lucide-react motionCopy these files into your project. Shared files are skipped if you already have them.
components/silicon-ui/usage-meter/usage-meter.tsxcomponents/silicon-ui/usage-meter/usage-meter.module.cssInstall the foundation once per app for the design and motion tokens: npx shadcn@latest add @silicon-ui/silicon-foundation
| Prop | Type | Default |
|---|---|---|
label*What is measured, such as "Workspace storage". | string | — |
segments*Used amounts in display order. Up to four read clearly. | UsageMeterSegment[] | — |
limit*The plan limit, in the same unit as the segments. | number | — |
unit | string | "" |
decimalsDigits after the decimal point. | number | 1 |
freeLabel | string | "Free" |
overLabel | string | "Over limit" |
warnAtShare of the limit at which the meter warns that it is almost full. | number | .9 |