Popular Animation — Reference
Dock
The Dock is a CSS animation component that a macOS-style floating dock bar with magnifying hover effects and icon tooltips. Perfect for app navigation, dashboard toolbars, or any interface that benefits from a polished icon-bar interaction. It ships as self-contained HTML and CSS with no external dependencies, making it drop-in ready for any modern web project regardless of framework or build system.
When to use the Dock
- App chrome, admin dashboards, and multi-section SPAs
- Product cards, navigation items, and link interactions
- Contextual help, icon labels, and inline documentation
- Component libraries and design systems that need consistent motion patterns
- Progressive enhancement — works in all modern browsers, degrades gracefully
Performance characteristics
- GPU-accelerated — uses CSS transform and opacity so compositing happens off the main thread
- Zero JavaScript dependency in most configurations — no framework, no bundler required
- Approximately 60 fps on any device that supports CSS animations (Chrome 43+, Firefox 16+, Safari 9+)
- Self-contained in a single HTML file — no npm install, no build step, paste and ship
How it compares
Unlike equivalent JavaScript implementations, the Dock does not require any runtime library — there is nothing to install, bundle, or load asynchronously.
Compared to animated GIFs or video embeds, this CSS component is resolution-independent, theme-able via CSS custom properties, and weighs a fraction of the equivalent media file.
Source code
CSS
* { box-sizing: border-box; }
body {
margin: 0;
min-height: 100vh;
display: flex;
align-items: center;
justify-content: center;
background: #0a0a0a;
font-family: system-ui, sans-serif;
}
.dock-wrap {
width: 100%;
max-width: 56rem;
height: 16rem;
display: flex;
align-items: center;
justify-content: center;
padding: 0.5rem;
}
.dock-bar {
display: flex;
align-items: center;
gap: 0.25rem;
padding: 0.5rem;
border-radius: 1rem;
backdrop-filter: blur(12px);
-webkit-backdrop-filter: blur(12px);
background: rgba(23,23,23,0.9);
border: 1px solid rgba(255,255,255,0.1);
box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
animation: float 4s ease-in-out infinite;
}
.dock-bar:hover { box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04); }
@keyframes float {
0%, 100% { transform: translateY(0); }
50% { transform: translateY(2px); }
}
.dock-btn {
position: relative;
padding: 0.75rem;
border: none;
border-radius: 0.5rem;
background: transparent;
color: #fafafa;
cursor: pointer;
transition: background-color 0.2s, transform 0.2s;
}
.dock-btn:hover {
background: rgba(255,255,255,0.08);
transform: scale(1.1) translateY(-2px);
}
.dock-btn:active { transform: scale(0.95); }
.dock-btn svg { width: 1.25rem; height: 1.25rem; display: block; }
.dock-btn .tooltip {
position: absolute;
left: 50%;
top: -2rem;
transform: translateX(-50%);
padding: 0.25rem 0.5rem;
border-radius: 0.25rem;
font-size: 0.75rem;
white-space: nowrap;
background: #27272a;
color: #fafafa;
opacity: 0;
pointer-events: none;
transition: opacity 0.2s;
}
.dock-btn:hover .tooltip { opacity: 1; }HTML
<div class="dock-wrap">
<div class="dock-bar">
<button class="dock-btn" type="button"><span class="tooltip">Home</span><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m3 9 9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"/><polyline points="9 22 9 12 15 12 15 22"/></svg></button>
<button class="dock-btn" type="button"><span class="tooltip">Search</span><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="11" cy="11" r="8"/><path d="m21 21-4.3-4.3"/></svg></button>
<button class="dock-btn" type="button"><span class="tooltip">Settings</span><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"/><circle cx="12" cy="12" r="3"/></svg></button>
<button class="dock-btn" type="button"><span class="tooltip">Folder</span><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2z"/></svg></button>
<button class="dock-btn" type="button"><span class="tooltip">User</span><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2"/><circle cx="12" cy="7" r="4"/></svg></button>
</div>
</div>Full source
<!DOCTYPE html>
<html>
<head>
<style>
* { box-sizing: border-box; }
body {
margin: 0;
min-height: 100vh;
display: flex;
align-items: center;
justify-content: center;
background: #0a0a0a;
font-family: system-ui, sans-serif;
}
.dock-wrap {
width: 100%;
max-width: 56rem;
height: 16rem;
display: flex;
align-items: center;
justify-content: center;
padding: 0.5rem;
}
.dock-bar {
display: flex;
align-items: center;
gap: 0.25rem;
padding: 0.5rem;
border-radius: 1rem;
backdrop-filter: blur(12px);
-webkit-backdrop-filter: blur(12px);
background: rgba(23,23,23,0.9);
border: 1px solid rgba(255,255,255,0.1);
box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
animation: float 4s ease-in-out infinite;
}
.dock-bar:hover { box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04); }
@keyframes float {
0%, 100% { transform: translateY(0); }
50% { transform: translateY(2px); }
}
.dock-btn {
position: relative;
padding: 0.75rem;
border: none;
border-radius: 0.5rem;
background: transparent;
color: #fafafa;
cursor: pointer;
transition: background-color 0.2s, transform 0.2s;
}
.dock-btn:hover {
background: rgba(255,255,255,0.08);
transform: scale(1.1) translateY(-2px);
}
.dock-btn:active { transform: scale(0.95); }
.dock-btn svg { width: 1.25rem; height: 1.25rem; display: block; }
.dock-btn .tooltip {
position: absolute;
left: 50%;
top: -2rem;
transform: translateX(-50%);
padding: 0.25rem 0.5rem;
border-radius: 0.25rem;
font-size: 0.75rem;
white-space: nowrap;
background: #27272a;
color: #fafafa;
opacity: 0;
pointer-events: none;
transition: opacity 0.2s;
}
.dock-btn:hover .tooltip { opacity: 1; }
</style>
</head>
<body>
<div class="dock-wrap">
<div class="dock-bar">
<button class="dock-btn" type="button"><span class="tooltip">Home</span><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m3 9 9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"/><polyline points="9 22 9 12 15 12 15 22"/></svg></button>
<button class="dock-btn" type="button"><span class="tooltip">Search</span><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="11" cy="11" r="8"/><path d="m21 21-4.3-4.3"/></svg></button>
<button class="dock-btn" type="button"><span class="tooltip">Settings</span><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"/><circle cx="12" cy="12" r="3"/></svg></button>
<button class="dock-btn" type="button"><span class="tooltip">Folder</span><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2z"/></svg></button>
<button class="dock-btn" type="button"><span class="tooltip">User</span><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2"/><circle cx="12" cy="7" r="4"/></svg></button>
</div>
</div>
</body>
</html>Frequently asked questions
How do I add the Dock to my project?
Copy the full source code from the code block on this page. Paste the <style> block into your stylesheet (or a <style> tag in your HTML head) and the HTML markup into your template. No npm install or build step is required — the animation is self-contained. To customize colors, speed, or size, use Grepped's workspace at grepped.dev/animations/popular/dock.
Is the Dock free to use?
Yes. All Grepped preset animations are free to use in personal and commercial projects. You may copy, modify, and redistribute the code without attribution. The only limitation is that you may not resell the presets themselves as part of a competing animation library.
Does the Dock work on mobile browsers?
Yes. The Dock uses standard CSS animations and transforms that are supported in all modern mobile browsers — Chrome for Android, Safari on iOS 9+, Samsung Internet, and Firefox for Android. Where JavaScript is used for interactivity (e.g. cursor effects), it falls back gracefully on touch devices.
Can I customize the Dock's colors, speed, or size?
Yes. Open the live customization workspace at grepped.dev/animations/popular/dock to adjust the animation with real-time sliders, color pickers, and toggles — no code required. For deeper changes, the source code uses CSS custom properties (variables) so you can edit them directly in your stylesheet.
Want to customize this animation or generate a new one from a text prompt?
Open in Workspace — it's free