A viscous, floating navigation dock that uses SVG filters to create organic gooey liquid effects. When you hover over items, the liquid surface bulges toward your cursor. Moving between items stretches and snaps a gooey bridge. A displacement map creates ripples across the dock surface.
Tag name: x-liquid-dock
<x-liquid-dock>
<button aria-label="Home">🏠</button>
<button aria-label="Search">🔍</button>
<button aria-label="Messages">💬</button>
<button aria-label="Profile">👤</button>
</x-liquid-dock>
| Attribute | Type | Default | Range | Description |
|---|---|---|---|---|
position | string | "bottom" | bottom top left right | Which screen edge the dock anchors to |
gap | number | 8 | 0 -- 40 | Space between items in pixels |
blur | number | 10 | 2 -- 30 | Gaussian blur stdDeviation for gooey merge |
threshold | string | "1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 18 -7" | feColorMatrix values | Controls gooey merge sharpness |
ripple-scale | number | 8 | 0 -- 40 | Displacement map intensity for ripple effect |
ripple-speed | number | 0.03 | 0.005 -- 0.15 | Turbulence seed animation speed |
color | string | "#6366f1" | Any CSS color | Liquid accent color |
magnet-radius | number | 150 | 40 -- 400 | How far cursor proximity affects items (px) |
magnet-strength | number | 0.6 | 0.0 -- 2.0 | Intensity of per-item scale/translate |
bob-intensity | number | 1.0 | 0.0 -- 2.0 | How much icons bob and tilt (0 = static icons, 2 = dramatic) |
disabled | boolean | false | presence | Disables animation and hover effects |
| Property | Type | Reflects Attribute |
|---|---|---|
position | string | position |
gap | number | gap |
blur | number | blur |
threshold | string | threshold |
rippleScale | number | ripple-scale |
rippleSpeed | number | ripple-speed |
color | string | color |
magnetRadius | number | magnet-radius |
magnetStrength | number | magnet-strength |
bobIntensity | number | bob-intensity |
disabled | boolean | disabled |
| Event | Bubbles | Composed | Cancelable | Detail |
|---|---|---|---|---|
x-liquid-dock-select | yes | yes | yes | { index: number, item: Element, source: "pointer" \| "keyboard" } |
| Slot | Description |
|---|---|
| (default) | Navigation items. Each direct child becomes a dock item with liquid blob backing. |
| Property | Default (light) | Default (dark) | Description |
|---|---|---|---|
--x-liquid-dock-bg | rgba(255,255,255,0.88) | rgba(15,23,42,0.84) | Dock background |
--x-liquid-dock-color | #6366f1 | #818cf8 | Liquid/accent color |
--x-liquid-dock-border | rgba(148,163,184,0.22) | rgba(51,65,85,0.9) | Border color |
--x-liquid-dock-shadow | 0 8px 24px rgba(15,23,42,0.12) | 0 14px 36px rgba(0,0,0,0.35) | Box shadow |
--x-liquid-dock-z-index | 50 | 50 | Stacking order |
--x-liquid-dock-item-size | 48px | 48px | Default item size |
--x-liquid-dock-item-active-scale | 1.3 | 1.3 | Scale factor for hovered item |
--x-liquid-dock-radius | 20px | 20px | Border radius |
--x-liquid-dock-padding | 8px | 8px | Internal padding |
--x-liquid-dock-gap | 8px | 8px | Gap between items |
--x-liquid-dock-glow-color | rgba(99,102,241,0.3) | same | Glow under hovered item |
<nav> element with role="navigation" and aria-label="Navigation dock".aria-hidden="true" with role="presentation".tabindex="0" automatically if not already focusable.x-liquid-dock-select.::slotted(:focus-visible).@media (prefers-reduced-motion: reduce) disables the animation loop entirely.The dock uses a "Magnetic Buoy" architecture — icons float like buoys in liquid mercury, staying crisp while physically interacting with the gooey surface beneath them.
Liquid layer — Contains the gooey-filtered blobs. An SVG filter chain (feGaussianBlur + feColorMatrix + feTurbulence + feDisplacementMap) is applied to this layer.
Items layer — Contains the <slot> for user-provided navigation items. These sit above the liquid layer and remain 100% crisp (never filtered).
Each slotted item gets two blobs inside the liquid layer:
When the cursor moves away, the phantom sinks back and merges flush with the rest blob.
Icons receive physically-motivated transforms controlled by bob-intensity:
Set bob-intensity="0" for static icons with liquid-only animation.
When an item is clicked or activated via keyboard, the displacement map intensity briefly spikes for ~300ms, creating a splash/ripple effect that propagates across the dock surface.
On each frame:
magnet-radius.<!-- Bottom (default) -->
<x-liquid-dock position="bottom">...</x-liquid-dock>
<!-- Top -->
<x-liquid-dock position="top">...</x-liquid-dock>
<!-- Left (vertical layout) -->
<x-liquid-dock position="left">...</x-liquid-dock>
<!-- Right (vertical layout) -->
<x-liquid-dock position="right">...</x-liquid-dock>
Can you improve this documentation?Edit on GitHub
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |