Block 276 of 297
Metaball Stats
Up to five impact figures as soft merging GPU blobs sized by value, mirrored as a semantic list.
- Puck key
- MetaballStatsBlock
- Export
- metaballStatsBlock
- React component
- <MetaballStats />
- Files
- components/puck/metaball-stats-block.tsx
- components/puck/metaball-stats.client.tsx
- Dependencies
- vgpu
- 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
An impact section where up to five figures appear as soft blobs that drift and merge, each sized by its value. On large screens the numbers sit in white on top of their blobs. Below that breakpoint the blobs become a shorter decorative band and the figures move into a two- or three-column grid underneath.
- Annual report or year-in-review highlights
- A donor-facing impact page with a handful of headline numbers
- Program results comparing reach across services
Writing the content
- Value is shown exactly as typed, but the number inside it sets blob size, so mixing 96% with 48,200 makes the percent blob the smallest.
- Values can be bound to a P1 data source with {{ }} tokens; Stats allows one to five items.
- Keep Blob color dark and Background color light, since large screens print white text on the blobs.
- Use the Source note to say where the figures come from; it hides when blank.
Accessibility
- Figures are a description list with label and value paired, and the blob panel is aria-hidden, so screen readers get only the numbers (WCAG 1.3.1).
- Blob area scales with the square root of each value, which keeps size differences proportionate rather than exaggerated.
- With reduced motion the blobs render one still frame; animation stops when the section scrolls away.
Customizing the code
- Needs vgpu and metaball-stats.client.tsx. The smooth-min k = 0.12 in field() controls how readily blobs merge; the layout() function sets slot positions and the 0.15 + 0.08 radius range.
- The overlay positioning switches on at lg:; change those prefixes to move the breakpoint where figures sit on the blobs.
Editor fields
What content editors see in the P1 sidebar when they select this block.
- Eyebrowtext
- Headingtextarea
- Heading levelselect
- Bodytextarea
- Statsarray
- Source notetext
- Blob colortext
- Background colortext
- Motionradio