Skip to content

feedback · Canvas 2D

MatchProgress

A progress bar made of matches: each one catches from the last as the work moves forward.

Progress bar drawn as a row of matches, each catching from the last as the job advances

  • Canvas 2D
  • Reduced motion: still-frame
  • 2.89 KB gzip
  • Layout shift 0
View the source Spec sheet as Markdown

Install

Install
pnpm dlx shadcn@4.21.1 add @frictionborn/match-progress

Playground

Drag Progress: each match catches as the value passes its share.

Palette
Your code
import { MatchProgress } from "@/components/ui/match-progress";

<MatchProgress label="Uploading your files" />

In a full example

The full example loads as you scroll to it.

Accessibility

  • role=progressbar with aria-valuenow/min/max and a required accessible name; the visible percentage is its text. The canvas is aria-hidden; before it mounts a plain bar shows the same value. Each burn lasts 7 s and stops.
  • Keyboard: None (not focusable)
  • Touch: None
  • WCAG criteria it is built for: 1.1.1, 1.3.1, 4.1.2

Props

PropTypeDefaultWhat it does
valuenumbernoneRequired. Progress 0-100; each match catches as the value passes its share.
labelstringnoneRequired. Accessible name of the progress bar.
matchesnumber12Number of matches in the row.
showValuebooleantrueShow the percentage under the row.
palette"fire" | "ice" | "neon" | "mono" | "custom""fire"Colours of the effect (DESIGN.md A8). custom reads --fb-heat-0..4 from the page.
pausedbooleanfalseUniversal pause prop: the effect stops drawing; the control keeps working.
maxTiernumber3Hard ceiling on the capability tier.
noncestringnoneCSP nonce for the component's <style> element.
classNamestring""Extra classes on the root.
styleReact.CSSPropertiesnoneInline styles on the root, merged after the palette variables.
refReact.Ref<HTMLDivElement>noneReceives the root element.

Measured on the bench

Measured by the automated bench at commit 801163e on 2026-10-21. These numbers are written by the bench, never by hand.

MeasureResult
Size, gzip2.89 KB at load, 0.02 KB loaded later
Layout shift0
Frames when nothing should moveoff screen 0, hidden tab 0, reduced motion 0
axe accessibility scan0 serious, 0 critical

Browsers it ran in

Automated Playwright runs, some with device emulation. Results from physical phones and tablets are still pending, so none are listed.

EnvironmentTierResultDateNotes
Chromium Desktop (SwiftShader)3pass2026-10-2116 passed, 0 failed
Chromium Mobile (Pixel 7 emulation)2pass2026-10-2115 passed, 0 failed
Firefox Desktop3pass2026-10-2114 passed, 0 failed
WebKit Desktop3pass2026-10-2115 passed, 0 failed
WebKit Mobile (iPhone 14 emulation)2pass2026-10-2115 passed, 0 failed

On different devices

Reduced motion (still-frame): The reached matches stand lit with a steady glow; no flame, no sparks, no burning down. One frame per change.

TierWhat it does
T3 FullAnimated at DPR <= 2 with the full particle count
T2 StandardAnimated at DPR <= 1.5 with half the particles
T1 LiteSame as tier 2
T0 StaticOne still frame on the canvas (reduced motion, Save-Data, no WebGL2), redrawn only when the value changes

Content Security Policy

  • Works without 'unsafe-eval'.
  • Needs no reveal gate.
  • Sets inline style attributes, so allow style-src-attr 'unsafe-inline'.

Goes well with