Skip to content

Block 144 of 297

Before/After Impact

Side-by-side before and after program figures with paired bars, a labeled change and a source line.

Puck key
BeforeAfterImpactBlock
Export
beforeAfterImpactBlock
React component
<BeforeAfterImpact />
Path
components/puck/before-after-impact-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 comparison panel that shows each tracked outcome before and after your program, with paired bars and a labeled change, followed by who was measured and the source. On tablets and desktops it reads as a table-like grid with column headings; on phones each outcome stacks, with Before and After labels shown above the numbers.

  • An impact or results page for a program evaluation
  • A grant report summary published on the website
  • A donor page that shows measurable change
Writing the content
  • Use numbers in Before and After (like 34% or 2.1). Bars only draw when both parse as numbers, scaled to the larger of the two.
  • Spell out the Change label, like +38 points or Down by half. Change direction only sets the arrow, so the label must say whether it's good.
  • Fill Who was measured with the group and period, and always add a Source line.
  • The panel holds one to six outcomes. Use Note for context such as "Median, not average".
Accessibility
  • Each outcome is a heading one level below the block heading, with values in a description list. The visual header row is hidden, and its labels remain as hidden terms (WCAG 1.3.1).
  • Bars and arrows are hidden from assistive technology, so the written values and change label carry the meaning.
  • The change chip adds the Change column label as hidden text, so it is announced as, for example, "Change: +38 points".
Customizing the code
  • After values, bars and change chips use Tailwind indigo, and before bars are neutral-400; swap these to fit your palette.

Editor fields

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

  • Headingtextarea
  • Heading levelselect
  • Introtextarea
  • Before labeltext
  • After labeltext
  • Change column labeltext
  • Outcomesarray
  • Who was measuredtext
  • Source linetext