Block 189 of 297
Giving Totals
Headline giving figures plus a by-focus-area bar list with computed shares and a visible source line.
- Puck key
- GivingTotalsBlock
- Export
- givingTotalsBlock
- React component
- <GivingTotals />
- Path
- components/puck/giving-totals-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 headline figures section for a grantmaker: up to four large numbers in a ruled row, then an optional breakdown panel with a bar for each focus area, its amount and its percentage of the total. Figures go two across on tablets and up to four on large screens. It suits an about page or annual report summary where the totals need a cited source.
- A foundation's "Our impact" or about page
- An annual report summary section
- A donor-facing page on cumulative giving
Writing the content
- Type each Figure exactly as it should appear, like "$214M" or "1,286"; headline figures are not calculated.
- Enter each Amount granted in dollars. Percentages are calculated from these, and areas show in the order you list them, so put the largest first.
- Bar length is relative to the largest area, not its share of the total, so the top bar always fills the track.
- Always fill in Source line, like your audited statements or Form 990. Up to four figures and eight areas fit.
Accessibility
- Headline figures are a description list, so each number is announced with its label (WCAG 1.3.1).
- Every bar's amount and percentage are written as text and the bars are hidden from screen readers, so nothing depends on bar length (WCAG 1.4.1).
- The breakdown list is labelled by Breakdown heading, or "Grants by focus area" when blank.
Customizing the code
- The first bar is bg-indigo-700 and the rest bg-indigo-500; figures use text-indigo-700.
- Bar width is computed as a share of the largest value in render; change it to v / total if you want true proportions.
Editor fields
What content editors see in the P1 sidebar when they select this block.
- Eyebrowtext
- Headingtext
- Heading levelselect
- Introtextarea
- Headline figuresarray
- Breakdown headingtext
- Focus areasarray
- Source linetext
- Link texttext
- Linktext