Block 46 of 297
Fundraising Progress
A campaign goal with an accessible progress bar and quick-give amounts.
- Puck key
- ImpactProgressBlock
- Export
- impactProgressBlock
- React component
- <ImpactProgress />
- Path
- components/puck/impact-progress-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 campaign section with the heading and appeal on the left and a white card on the right showing the amount raised against the goal, a progress bar, a short stats line and quick-give amount buttons above a main donate button. Set the goal to zero and it shows only the running total. The card drops below the copy on smaller screens.
- A year-end or matching-gift campaign page
- A capital or equipment drive with a fixed dollar target
- A giving-day page that staff update as gifts arrive
Writing the content
- Enter Amount raised and Goal as whole numbers without symbols or commas; the block formats them with the Currency symbol.
- The percent funded is calculated for you and the bar caps at 100%. Donors and Deadline are free text.
- Add up to six Quick-give amounts. A blank Link falls back to the main Button link.
- The total is only as current as the last edit, so update it on a schedule you can keep.
Accessibility
- The bar is a role="progressbar" with an aria-valuetext such as "$48,250 raised of $75,000 goal, 64%" (WCAG 4.1.2).
- The percentage also shows as text, so progress isn't conveyed by the bar alone (WCAG 1.4.1).
- Amount and donate buttons are links at least 48px tall with an indigo focus outline.
Customizing the code
- The bar fill is bg-indigo-600 on a bg-neutral-200 track with h-3 height; the funded percentage text uses indigo-700.
- formatNumber uses toLocaleString("en-US"); change the locale for other number formats. Quick-give buttons lift slightly on hover through hover:-translate-y-0.5.
Editor fields
What content editors see in the P1 sidebar when they select this block.
- Headingtextarea
- Heading levelselect
- Bodytextarea
- Amount raisednumber
- Goalnumber
- Currency symboltext
- Donorstext
- Deadlinetext
- Quick-give labeltext
- Quick-give amountsarray
- Button texttext
- Button linktext