Component packs › Livery › Contrast Picker

Contrast Picker

Pick an accent and the contrast ratios update live with AA and AAA marks; Fix it snaps to the nearest shade that passes.

Contrast Picker is an accent picker with contrast from Livery, a component pack with 8 components: Theme switcher components where every change repaints the page, not just the control. Price: $2 for the whole pack.

Built with: live WCAG ratios, snap to passing shade, saturation and lightness plane.

Code: React and Next.js (TypeScript), Vue 3, plain HTML/CSS/JS, Tailwind CSS v4 and Motion (motion.dev). No npm packages needed. Keyboard accessible, with a reduced-motion version, in dark and light.

Contrast Picker props

PropTypeDefaultDescription
valuestring
darkboolean
autoplayboolean
onChange(c: { hex: string; onAccent: number; onWhite: number; onDark: number }) => void

Methods on the ref

Use it in React

import ContrastPicker from './ContrastPicker';

<ContrastPicker />

The Vue, HTML, Next.js, Tailwind and Motion versions take the same options.

More in Livery

Good for: Theme and dark mode.