Skip to content
ProLifetime access for $199, paid once, every future release included
Truffle UI

Score Gauge

ProNew

A 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

PropTypeDefault
score*number | null

The score, from 0 to 100. Pass `null` while it is being measured.

—
label*string

What was scored, e.g. "Performance". Shown under the ring.

—
sizekeyof typeof sizes"md"
classNamestring—

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.