React animated backgrounds
14 animated backgroundsLive previewFull source in your repo
Moving backgrounds for hero sections and landing pages, from a few blurred shapes in plain CSS to full width WebGL shaders. One command copies the source into your React project, and you keep every line of it.
Works with
- React
- Next.js
- TypeScript
- Tailwind CSS
WebGL and Three.js shader backgrounds
Full width section backgrounds drawn by Three.js shaders: water caustics, topographic contour lines, a warp tunnel, colour bands and a noise field. Each ships light and dark palettes.
Animated Background With Noise FieldFull-bleed WebGL motion background with domain-warped FBM noise, smooth Gaussian mouse warp, film grain, and edge vignette, built on Three.js with separate light and dark palettes, fully configurable color and motion props.
Animated Background With Color BandsFull-bleed WebGL background with flowing color bands, pointer parallax, warp strength, and configurable palette, built on Three.js with transparent compositing, film grain, and light/dark defaults.
Animated Background With Contour LinesReact animated topographic background with contour lines that respond to the cursor. Built with Three.js, with light and dark color palettes.
Animated Background With Warp TunnelFull-bleed WebGL background with radial light streaks rushing through a spiral tunnel toward a cursor-following vanishing point, built on Three.js with a three-stop depth gradient, fog, twist, film grain, and separate light and dark defaults.
Animated Background With Liquid CausticsReact WebGL background with animated water caustics, cursor interaction, and light and dark palettes. Built with Three.js.
CSS animated backgrounds with no WebGL
Lava lamp shapes, a soft aurora gradient and a morphing blob, built from blur and keyframes instead of a shader, so they paint with the page and never wait on a GPU context.
Morphing Shape BackgroundLava lamp background for React heroes: soft gradient shapes that drift and melt.
Aurora BackgroundAurora background of blurred light on Framer Motion, with grain that kills banding.
Blob AnimationBlob animation in CSS: a morphing gradient blob, soft glow, outline, or image mask.
Interactive backgrounds that react to the cursor
Pointer reactive layers for a hero, drawn in WebGL or on canvas: gradient stripes that rise toward the cursor, film grain light leaks, fluted glass and a photo under rippling water.
Gradient StripesA brand gradient sliced into glowing stripes that rise toward the pointer.
Gradient GrainLight leaks on film: saturated colour that burns to white under fine grain.
Fluted GlassAny photo seen through fluted glass, sliced into soft ribs that follow the pointer.
Glass StripesDiagonal glass stripes refract a slow, glowing light that follows your pointer.
Particle ImageA photo rebuilt as halftone dots on springs that scatter from the pointer.
Liquid Ripple ImageA photo under simulated water where waves spread, cross and bounce off edges.
How to add an animated background to a React website
An animated background is a layer that moves behind a section while the content on top stays still. In React it is a component positioned absolutely behind its children, filling the section, with the headline and buttons rendered above it. The first decision is the technique, because it sets the cost: CSS moves shapes and gradients the browser already knows how to paint, while WebGL runs a shader that computes every pixel on every frame.
The usual CSS recipe for an animated gradient background is a gradient four times wider than its element, with keyframes sliding background-position back and forth. It works, but the browser repaints the whole area on every frame. Moving pre-blurred shapes with transform keeps the work on the compositor instead, which is how Aurora Background drifts its colour blobs through Framer Motion. Morphing Shape Background goes further and needs no library at all: each shape is a div whose border radius and rotation run on keyframes under heavy blur, so it reads as a slow lava lamp rather than distinct shapes.
Large soft gradients show banding, visible steps where the colour should be smooth, and the fix is grain. Morphing Shape Background and Aurora Background both lay a fine noise overlay over the colour for exactly that reason, and Gradient Grain makes the grain the look, with light that blooms out of black and burns to white like a leak on film. A mesh gradient, colour blended from several points instead of along one line, is the still version of the same idea, and Gradient Grain includes a mesh composition that moves.
Reach for WebGL when the surface depends on light rather than on shapes. Refracted water caustics, contour lines that keep an even stroke on a slope, and streaks rushing toward a vanishing point cannot be built from moving rectangles. The five background blocks here are written on Three.js for that reason, with colour, warp and motion exposed as props. They compile a shader before the first frame, so give the section a solid background colour underneath and the effect fades in over it instead of over a white flash.
Performance is where an animated background earns or loses its place. Above the fold, a WebGL layer can become the element Google times for Largest Contentful Paint, and on a mid range phone the shader compile is a visible pause. The cursor driven components here limit the cost in different ways: Gradient Stripes and Gradient Grain stop drawing when they scroll out of view, Fluted Glass caps pixel density and pauses once settled, and Particle Image and Liquid Ripple Image park their loops when nothing is moving.
Readability decides which background suits which section. A field whose brightness moves needs its own scrim behind any text, because contrast against an average colour is not contrast. The contour lines block is drawn in line rather than in fill, so most of its surface stays empty and a paragraph on top keeps its contrast. The warp tunnel pulls the eye to its centre and suits one claim in large type, not a section of body copy, and the colour bands block renders on a transparent canvas, so the design already behind the section keeps showing through.
Respect reduced motion. A drifting or rushing background is a common motion sickness trigger, and the browser reports when someone has asked for less movement through the prefers-reduced-motion media query. Every component in the cursor and CSS sections above settles to a still frame when that setting is on. For the WebGL blocks, test once with the setting enabled before shipping, especially the warp tunnel, where it matters most.

