Score Gauge
ProNewA score out of 100 as a ring, in the style audit tools use. The ring draws and the number counts up once, both move to a new value instead of jumping, and a measuring state turns while it waits.
Installation
pnpm dlx shadcn@latest add @viewport/score-gauge
First time? Add the @viewport registry to components.json. Setup takes one minute.
Usage
The code behind the preview above comes with Truffle Pro.
Props
| Prop | Type | Default |
|---|---|---|
| score* | number | nullThe score, from 0 to 100. Pass `null` while it is being measured. | — |
| label* | stringWhat was scored, e.g. "Performance". Shown under the ring. | — |
| size | keyof typeof sizes | "md" |
| className | string | — |
Accessibility
- A meter whose value text is the score and its band in words.
- The band is a color, a word and a shape: circle, square or triangle.
- Measuring is announced as busy.
- Nothing counts or draws under reduced motion.