Performance: Spin animation (loading)
MEDIUM IMPACT
Spin animations affect the browser's paint and composite stages, impacting smoothness and interaction responsiveness.
<svg class="animate-spin w-12 h-12 text-blue-500" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10" stroke-opacity="0.25"/><path d="M4 12a8 8 0 018-8"/></svg>
<div class="animate-spin border-4 border-blue-500 border-t-transparent rounded-full w-12 h-12"></div>| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Border-based spin animation | Minimal (1 element) | 0 | High (continuous repaint) | [X] Bad |
| SVG spin animation | Minimal (1 element) | 0 | Low (mostly compositing) | [OK] Good |