How it works
Each slice of the donut is a circle's stroke fragment: stroke-dasharray set to the arc length followed by the remaining circumference, and stroke-dashoffset shifted negative so the fragment rotates to its starting angle. The entrance animates each slice's visible arc from zero to target with incrementing transition-delay, so the ring draws itself clockwise slice by slice.
The tap-to-explode interaction hides a famous trap: SVG transform origin defaults to the canvas top-left, not the circle center, so a naive translate flings slices to strange places. Pin transform-origin to the circle center (or set transform-box: fill-box per slice), then translate each slice outward 6 to 10px along its own angle bisector - that is a clean pull-out. The center label crossfades to the selected slice's name and percentage while the rest of the ring dims slightly.
How to use this prompt
For spending categories, time composition, channel mix - 3 to 6 parts of a whole. Provide names, values, and colors; the AI handles arc math and offset logic. For a more theatrical entrance, add: slices draw in 80 milliseconds apart, full ring in one second.
Tips for better results
Leave a 2-degree background-colored gap between slices - seamed rings read far more refined than solid ones. Keep the smallest slice above 3% or it becomes invisible and untappable. Use a fixed 8px pull-out distance for every slice, not proportional - small slices flying far look like they fell out. Crossfade the center text over 120 milliseconds so numbers never hard-swap. Link the legend: hovering a legend item pulls out its slice too, so exploration works from both directions. And keep stroke-linecap butt - round caps bulge at every slice junction.