Background Gradient Animation
interlace-ui/background-gradient-animationFreeComponent
The "lava lamp" surface: five radial-gradient blobs orbiting behind an SVG goo filter and a 40px blur, over a two-stop gradient backdrop, plus a sixth blob that eases toward the pointer.
Install it
npx shadcn@latest add https://ds.interlace.tools/r/background-gradient-animation.jsonSource
1"use client";23import {4 forwardRef,5 useEffect,6 useId,7 useRef,8 type ComponentPropsWithoutRef,9 type CSSProperties,10 type ReactNode,11} from "react";1213// @interlace/background-gradient-animation v1.2.0 — Interlace design system.14// Docs, props and live preview: https://ds.interlace.tools/c/background-gradient-animation15// What changed since: https://ds.interlace.tools/c/background-gradient-animation#history16// Generated banner — keep it, the upgrade diff reads this version.1718/**19 * @interlace/ui — BackgroundGradientAnimation20 *21 * The "lava lamp" surface: five radial-gradient blobs orbiting behind an SVG22 * goo filter and a 40px blur, over a two-stop gradient backdrop, plus a sixth23 * blob that eases toward the pointer.24 *25 * Every colour is a prop that falls back to an `--interlace-*` token, so the26 * default look is on-brand and no literal ships in source.27 *28 * ## Provenance29 *30 * Our reimplementation of the Aceternity UI component of the same name. What31 * is ours: the whole token fallback chain (upstream shipped colour literals);32 * self-scoping — the original mutated `document.body.style`, this one writes33 * its CSS variables to its own root so several instances can coexist; and a34 * pointer loop that actually schedules frames, replacing upstream's35 * stale-closure nested `setState` that never re-ran.36 *37 * ## Anatomy38 *39 * div (data-slot="background-gradient-animation",40 * isolate, backdrop linear-gradient)41 * ├─ svg.hidden (data-slot="gradient-filter" — feGaussianBlur42 * │ → feColorMatrix → feBlend, the goo)43 * ├─ div aria-hidden (data-slot="gradient-blobs", filter:url(#<gooId>))44 * │ ├─ div.animate-first … .animate-fifth45 * │ └─ div (data-slot="gradient-pointer" — only when active)46 * └─ div.z-10 (data-slot="gradient-content" — your children)47 *48 * ## Motion — two kinds, gated two ways49 *50 * The five orbits are CSS keyframes (`--animate-first`…`--animate-fifth` in51 * `styles/tokens.css`). They are named in that file's52 * `prefers-reduced-motion: reduce` block (`animation: none !important`) and53 * also caught by the wildcard in `styles/preflight.css`, so they need no JS.54 * The blobs stay on screen, parked.55 *56 * The pointer blob is a `requestAnimationFrame` loop writing57// … truncated
More from interlace-ui
All 140 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| A11y Startera11y-starter | interlace-ui | Components | Free | no deps | |
| Accordionaccordion | interlace-ui | Components | Free | no deps | |
| Alertalert | interlace-ui | Components | Free | no deps | |
| Alert Dialogalert-dialog | interlace-ui | Components | Free | no deps | |
| Animated Gradient Textanimated-gradient-text | interlace-ui | Components | Free | no deps | |
| Animated Grid Patternanimated-grid-pattern | interlace-ui | Components | Free | no deps | |
| Animated Listanimated-list | interlace-ui | Components | Free | no deps | |
| Article Cardarticle-card | interlace-ui | Components | Free | no deps |
