Skip to content

Block 286 of 297

Sunburst Celebration

Goal-reached section whose sunburst turns and confetti falls only once the raised amount meets the goal.

Puck key
SunburstCelebrationBlock
Export
sunburstCelebrationBlock
React component
<SunburstCelebration />
Files
components/puck/sunburst-celebration-block.tsx
components/puck/sunburst-celebration.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

A centered campaign section with two states: before the goal is met it shows an in-progress badge and heading over still rays. Once Amount raised reaches Goal, it switches to the goal-met badge and heading, the rays turn and confetti falls. The large total and percent stay readable at any width.

  • Thanking donors after a campaign passes its goal
  • A giving-day page that should change on its own when the total lands
  • Reading, fitness or volunteer-hour challenges with a target
Writing the content
  • Fill both heading pairs: Badge and Heading (goal met), and Badge (in progress) and Heading (in progress). The block picks one set from the numbers.
  • Amount raised and Goal ignore commas and symbols, so they can be bound to a P1 data source with {{ source.field }} tokens.
  • Leave Currency symbol blank for counts such as books read or hours served.
  • Keep Ray color close to Background color; the text is dark and sits directly over the rays.
Accessibility
  • The section is labelled by whichever heading is showing, and every figure is server-rendered text.
  • Motion runs only after the goal is met, and reduced-motion visitors always get a still frame; confetti fades over the center text column.
  • The goal-met badge pairs its message with a check icon, so the change isn't signaled by color alone (WCAG 1.4.1).
Customizing the code
  • Requires vgpu and sunburst-celebration.client.tsx. Ray spin is t * 0.05 in fs_main, and the two confetti() calls set the far and near layer density.
  • The total, badge and button use Tailwind indigo; the Rays options (10, 14, 20) set the wedge count.

Editor fields

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

  • Amount raisedtext
  • Goaltext
  • Currency symboltext
  • Supporterstext
  • Badge (goal met)text
  • Heading (goal met)textarea
  • Badge (in progress)text
  • Heading (in progress)textarea
  • Heading levelselect
  • Bodytextarea
  • Button texttext
  • Button linktext
  • Background colortext
  • Ray colortext
  • Confetti color 1text
  • Confetti color 2text
  • Raysradio
  • Motionradio