Skip to content

Block 141 of 297

Matching Gift

Your-gift-doubles banner with matcher, ratio, cap, deadline, progress toward the cap and an employer-match link.

Puck key
MatchingGiftBlock
Export
matchingGiftBlock
React component
<MatchingGift />
Path
components/puck/matching-gift-block.tsx
Dependencies
None
License
MIT

About this block

When to use it, how to write for it, and what to change in the code.

What it's for

A dark indigo banner for a challenge match: a giant ratio such as 2× on the left, and on the right the heading, body, who is matching, the cap, the deadline, a progress bar toward the cap and a give button. It can also point donors to an employer-match lookup. The ratio panel stacks above the copy on phones.

  • A giving-day or year-end campaign with a matching donor
  • A donate page during a time-limited challenge grant
  • A capital campaign update showing how much of the match is claimed
Writing the content
  • Always fill Ratio caption, like "Every $1 becomes $2"; the large ratio is visual only, and the caption is what screen readers hear.
  • The progress bar shows only when Cap and Matched so far both contain numbers. Keep Matched so far current, or bind it to a data source.
  • Write the Deadline in words, like Midnight, Dec. 31, and fill each matching label so the terms read clearly.
  • Employer match text only shows when Employer link text is also filled.
Accessibility
  • The progress bar uses role progressbar with min, max and current values and text like "63% of the match claimed" (WCAG 4.1.2).
  • The oversized ratio is hidden from screen readers, so the Ratio caption carries its meaning, and match terms are a description list.
  • The give button is at least 48px tall and both links use a white focus outline that shows against the dark background.
Customizing the code
  • The banner is bg-indigo-950 with a bg-indigo-700 ratio panel; change the indigo- family to rebrand.

Editor fields

What content editors see in the P1 sidebar when they select this block.

  • Match ratiotext
  • Ratio captiontext
  • Headingtextarea
  • Heading levelselect
  • Bodytextarea
  • Matcher labeltext
  • Matchertext
  • Cap labeltext
  • Captext
  • Deadline labeltext
  • Deadlinetext
  • Progress labeltext
  • Matched so fartext
  • Button texttext
  • Button linktext
  • Employer match texttext
  • Employer link texttext
  • Employer linktext