The Stylish Animated Search Button is a free, copy-paste ready
circular search UI button component built with pure HTML,
CSS custom keyframes, and vanilla JavaScript. It is designed as a
production-ready animated search trigger — providing a
full visual lifecycle from idle to searching to complete. The button is an
80×80px circle with glassmorphism:
background: rgba(255,255,255,0.06),
border: 1px solid rgba(255,255,255,0.15),
backdrop-filter: blur(12px),
box-shadow: 0 8px 25px rgba(0,0,0,0.5).
It shares the same architectural pattern as the
Enhanced Animated Refresh Button
but is tuned smaller, softer, and slightly slower — appropriate for a search
query state rather than a hard reload.
The SVG icon is an inline magnifier:
<circle cx="11" cy="11" r="8"/> +
<line x1="21" y1="21" x2="16.65" y2="16.65"/> —
the line endpoint is at 11 + 8×cos(45°) ≈ 16.66, placing it
exactly at the circle edge. Hover state:
transform: scale(1.15) rotate(-3deg) + glow
box-shadow: 0 0 25px 6px rgba(124,58,237,0.7). SVG turns
cyan (#06b6d4) and rotates 20 degrees. Click state:
icon hides, spinner shows — 60×60px,
border-top-color: #06b6d4, at 1s linear. The
ring activates via .active class —
90×90px, border-top-color: #7c3aed (purple),
border-right-color: #ec4899 (pink), at 1.5s linear
(ratio 3:2 with spinner — they re-align every 3 seconds). Progress loop:
progress += 10 + Math.random() * 15 every 150ms until
≥100, then restores.
Both buttons use identical CSS architecture (glassmorphism circle → hover glow → click spinner + ring → progress reset) but are deliberately tuned differently. The search button is 10px smaller (80px vs 90px), uses a lighter blur (12px vs 14px), gentler hover scale (1.15 vs 1.2), tighter glow spread (6px vs 8px), and a slower progress loop (10+rnd*15 at 150ms vs 15+rnd*20 at 120ms). The ring runs at 1.5s (vs 1.2s) — creating a 3:2 ratio with its 1s spinner, producing a smooth 3-second re-alignment cycle. These values make the search button feel considered and deliberate — the visual language of waiting for query results rather than a hard system reload.
Released under Creative Commons Attribution 4.0 International (CC BY 4.0). Free for personal and commercial use with attribution to Coodeverse.
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Stylish Animated Search Button</title>
</head>
<body>
<div class="search-btn" id="searchBtn">
<svg id="searchIcon" viewBox="0 0 24 24" fill="none" stroke="currentColor">
<circle cx="11" cy="11" r="8"/>
<line x1="21" y1="21" x2="16.65" y2="16.65"/>
</svg>
<div class="spinner" id="spinner"></div>
<div class="ring" id="ring"></div>
</div>
</body>
</html>
Common questions about the free Stylish Animated Search Button project.
Yes — 100% free under Creative Commons Attribution 4.0. No sign-up, no payment. Click Download Project and use it as an animated search or loading state button in any project with attribution to Coodeverse.
Same glassmorphism + spinner + ring architecture, tuned differently: search button is 80px (vs 90px), blur(12px) (vs blur(14px)), hover scale(1.15) (vs scale(1.2)), glow spread 6px (vs 8px), spinner 60px at 1s (vs 70px at 0.9s), ring 90px at 1.5s (vs 100px at 1.2s), progress 10+rnd*15 at 150ms (vs 15+rnd*20 at 120ms). The SVG icon is a magnifier (circle cx:11 cy:11 r:8 + diagonal line) rather than two refresh arcs. The search button's slower feel suits a query-wait state.
Use two elements inside viewBox="0 0 24 24": <circle cx="11" cy="11" r="8"/> for the lens and <line x1="21" y1="21" x2="16.65" y2="16.65"/> for the handle. The line endpoint 16.65 = 11 + 8×cos(45°) ≈ 11 + 5.66, placing it exactly at the circle's bottom-right edge. Set fill="none" stroke="currentColor" stroke-width="2.5". Uses only two SVG primitives with no external image or icon library.
Equal width/height + border-radius:50% for the circle. Then: background:rgba(255,255,255,0.06) (6% white translucent fill), border:1px solid rgba(255,255,255,0.15) (frosted edge), backdrop-filter:blur(12px) (blurs the content behind — the core glassmorphism property), box-shadow:0 8px 25px rgba(0,0,0,0.5) (depth), overflow:hidden (clips spinner and ring within the circle).
On .search-btn:hover svg, apply stroke:var(--accent1) to change from white to cyan (#06b6d4) and transform:rotate(20deg) scale(1.1) to rotate the magnifier slightly and enlarge it. The rotation mimics a scanning motion. Add transition:0.3s ease on the SVG element to smooth both changes. Combined with the parent button's scale+glow, the result is a layered hover response that communicates interactivity clearly.
Give each its own duration: spinner animation:spin 1s linear infinite, ring animation:ringSpin 1.5s linear infinite. Both keyframes are identical (to{transform:rotate(360deg)}), only the timing differs. At 1s vs 1.5s (ratio 2:3), they re-align every 3 seconds (LCM of 1 and 1.5). Between those points the ring continuously lags behind the spinner, creating a slow orbital parallax effect with zero additional CSS complexity.
Browse coodeverse.com/projects — Enhanced Animated Refresh Button (same architecture, refresh icon), Cute Lamp Character (CSS keyframe character), Gold Ace Poker Cards (SVG filters), Modern Neon Clock, NEXUS 3D CSS Cubes, and more. All 100% free with complete HTML CSS JavaScript source code.