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

Score Medallion

ProNew

A coin with a fluted metallic rim and a score on its face, in platinum, gold, silver, bronze and emerging tiers.

Installation

pnpm dlx shadcn@latest add @viewport/score-medallion

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

The number struck on the face, e.g. a score out of 100.

—
tier*keyof typeof tiers

The metal of the rim.

—
labelstring

What the score measures, for screen readers, e.g. "Reputation score".

"Score"
sizekeyof typeof sizes"sm"
showLabelboolean

Show the tier's name beside the medallion.

false
classNamestring—

Accessibility

  • An image named with what the score measures, the score and the tier.
  • The tier can be written beside it, so metal is not the only signal.
  • Server component with no client JavaScript.