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

Contrast Proof

ProNew

Swap ink and paper swatches on a live type specimen and measure their WCAG contrast ratio.

Installation

pnpm dlx shadcn@latest add @viewport/contrast-proof

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
colors*Ink[]

Six-digit hexadecimal colors, including the leading hash.

—
specimenstring

Type sample shown in the chosen foreground and background.

"Aa"

Accessibility

  • Swatch buttons are labeled and expose pressed state. The ratio and AA result are written in text.