Pulse and attention states
Use radius, opacity, or transform animation for small status badges and loading hints.
svg animation examples
Good SVG animation examples show the code, the motion idea, and the tradeoff. Use these patterns as starting points, then preview and sanitize before shipping.
Use radius, opacity, or transform animation for small status badges and loading hints.
Use stroke-dasharray and stroke-dashoffset when the shape should appear to draw itself.
Keep icon motion short, reversible, and readable at the final UI size.
This small badge uses declarative SVG animation without JavaScript.
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 180 120" role="img"><title>Animated pulse badge</title><rect width="180" height="120" rx="18" fill="#11151c"/><circle cx="90" cy="60" r="24" fill="#6ee7d8"><animate attributeName="r" values="18;30;18" dur="1.8s" repeatCount="indefinite"/><animate attributeName="opacity" values="0.72;1;0.72" dur="1.8s" repeatCount="indefinite"/></circle><path d="M72 60h36" stroke="#ffffff" stroke-width="8" stroke-linecap="round"/></svg>
Start with one visible property such as opacity, transform, radius, or stroke-dashoffset, then preview the result at the size it will ship.
Treat copied SVG as untrusted. Validate it first and remove scripts, event handlers, external references, and unsupported markup.
CSS is often better for UI states. SMIL is useful when the motion should travel with the standalone SVG file.