Block 05 of 297
Stats Hero
Headline and calls to action over a wide photo, with three or four sourced key figures docked on its bottom edge.
- Puck key
- HeroStatsBlock
- Export
- heroStatsBlock
- React component
- <HeroStats />
- Path
- components/puck/hero-stats-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
Headline and buttons sit above a wide photo, and a white panel of one to four key figures overlaps the photo's bottom edge. A small source line can follow. It works when a few numbers make the case faster than a paragraph. On phones the figures stack in one column and the photo crops to 4:3.
- A college or school district home page with enrollment and outcome figures
- An annual report or impact landing page
- A program page backed by headline results
Writing the content
- Keep each figure's Value short, such as 12,400, 94% or $2.1M; the Label below can carry the detail.
- Use three or four Figures. Four switch to a two-by-two grid on tablets and one row on desktop.
- Fill in Source whenever the numbers are claims, and name the actual report or dataset. The default text is placeholder copy and should be replaced.
- Leave Image URL blank to show the figures on a plain band without the photo.
Accessibility
- Figures are a description list: each label is a dt and each value its dd, so the pairing survives in assistive tech (WCAG 1.3.1). Values display above labels visually through CSS only.
- Heading level is set in the editor (H1 to H4) with no visual change.
- Both links have indigo focus outlines and a 44px minimum height; the photo alt text is editor-supplied.
Customizing the code
- Column counts per figure count live in the STAT_COLS map near the top of the file.
- The photo crop steps through aspect-4/3, sm:aspect-2/1 and lg:aspect-21/9; the overlap depth is -mt-10 and sm:-mt-20.
Editor fields
What content editors see in the P1 sidebar when they select this block.
- Eyebrowtext
- Headingtextarea
- Heading levelselect
- Bodytextarea
- Primary button texttext
- Primary button linktext
- Secondary link texttext
- Secondary linktext
- Image URLtext
- Image alt texttext
- Figuresarray
- Sourcetext