Skip to content
VenusUI
Get started

Score Gauge

A speedometer-style gauge whose needle sweeps to a score, with colored rating bands.

Preview

Installation

npx shadcn@latest add @venusui/score-gauge

Run this in a project set up with shadcn. If you haven’t set it up yet, run npx shadcn@latest init first.

Files added to your project

Paths use the default shadcn aliases. The CLI follows the aliases in your components.json.

  • @/components/ui/score-gauge.tsx

Usage

The code behind the preview above.

score-gauge-demo.tsx

import { ScoreGauge } from "@/components/ui/score-gauge"

export default function ScoreGaugeDemo() {
  return <ScoreGauge className="w-[min(18rem,calc(100vw-3rem))]" value={742} label="Credit score" caption="Updated 2 Nov · +12 this month" />
}

API reference

PropTypeDefaultDescription
valuenumber—The score.
min, maxnumber300, 850Range of the dial.
labelstring—Accessible name and caption, e.g. “Credit score”.
bands{ upTo: number; label: string; color: string }[]—Colored ranges; defaults to credit-score bands (Poor to Excellent).
captionstring—Small text under the rating.

All <div> props.

Requirements

  • React 19 and Tailwind CSS v4.

Customization

  • Use your own bands for other scores, e.g. 0–100 with Poor, Needs work and Great.

Accessibility

  • It's a meter whose value text includes the rating (“742, Very good”).
  • With reduced motion the needle doesn't sweep.

Troubleshooting

The needle stays at the start.
It sweeps when 40% of the gauge is in view; check that it isn't hidden or off screen.
Unknown registry "@venusui"
Your shadcn CLI couldn’t find the namespace in the shadcn registry index. Use the latest CLI (npx shadcn@latest), install by URL, or register it with its address: npx shadcn@latest registry add @venusui=https://venusui.com/r/{name}.json.
No components.json found
Run npx shadcn@latest init in your project first.
Loading preview

Analog Clock

Data display

A station clock whose needle waits at twelve; drag the minute hand to set it by hand.

Loading preview

Avatar Stack

Data display

Overlapping avatars with a +N counter that spread apart on hover.

Loading preview

Bookshelf

Interactive

Books on a wooden shelf whose spines lift on hover and pull out when selected, with a matching cover.