How to make a Stripe-style animated gradient
The slow, glossy wash of color across the top of Stripe's homepage is one of the most imitated effects on the web. Here is how that kind of gradient works, how to make your own version in Ribbonwash in about three minutes, and how to export it as HTML or React.
Ribbonwash is an independent tool, not affiliated with or endorsed by Stripe. “Stripe” is a trademark of its owner and is used here only to describe a visual style.
How the effect works
Public write-ups and open-source recreations of the effect describe the same recipe:
- WebGL, not CSS. The gradient is drawn on a
<canvas>with WebGL rather than with a CSS gradient. - A rippling plane. A finely subdivided plane, tilted on a slight diagonal, has its vertices pushed around by animated simplex noise. That is what gives the movement its “cloth in the wind” feel.
- A few strong colors. Four colors, set as CSS custom properties, are layered by the same noise and blended per vertex. A static image stands in when WebGL isn't available.
- An angled edge. The colored section is often cut diagonally, so the band seems to slice across the page.
Because the movement comes from noise over time, it never repeats exactly. That is ideal for a live page, but it makes a seamless video loop hard, and you can't decide exactly where each color sits.
The Ribbonwash approach
Ribbonwash builds the same kind of look from ribbons instead of noise. A few wide, very soft curves make the color field, and one or two thin, bright ribbons give the glossy streak. You draw where each color goes, every motion runs a whole number of cycles per loop, and colors blend in OKLab so the overlaps stay vivid. The demo above has five curves: violet field, magenta wash, amber band, sky ribbon, light ribbon.
Make it in about 3 minutes
Load the starter scene (optional)
Download the Stripe-style scene used in the demo above, open the editor and choose Artworks → Open…. To build it yourself instead, choose Artworks → New artwork… → Blank.
Lay down the color field
With the Brush (B), drag three wide strokes on a diagonal, from bottom left to top right. Give them vivid neighbours — for example violet
#6B45F5, magenta#E8318Cand amber#FFB22E— then raise their width and softness until they melt into one field.Add the glossy streak
With the Pen (P), place three or four points along the same diagonal for a thin ribbon in a light sky blue such as
#6CC4F0, and a second, fainter one in near-white.Make it move
Open the Motion tab. Give the wide strokes Drift and Breathe so the field slowly changes shape, put Flow on the streak so color travels along it, and add Color shift to one stroke. Set the Loop to about 12 seconds for a calm pace.
Try other palettes
Press Shift+R (Recolor only) to try new colors while keeping the shapes and motion, or edit the anchor colors to match your brand.
Export the code
Choose Export → Code… and pick HTML snippet, React component or Complete ZIP (code export is part of Pro ($19, one-time)). Or export a video with Export → Video….
Use the exported code
The HTML snippet is one <div> and one script. Choose Height → Fill parent (background) in the export dialog and the gradient fills whatever section you put it in. This is its shape, with the scene data and the poster image shortened:
<section class="hero">
<div id="mesh-gradient" style="position:absolute;inset:0;overflow:hidden;background:#7A4CF0 center/cover no-repeat"></div>
<script src="mesh-runtime.min.js"></script>
<script>
(function () {
var el = document.getElementById('mesh-gradient');
var poster = 'data:image/jpeg;base64,…';
var scene = {"version":5, …};
el.style.backgroundImage = 'url(' + poster + ')'; // first frame, shown until WebGL is ready
if (!window.MeshRuntime) return;
window.meshGradient = MeshRuntime.createMeshGradient(el, scene, { poster: poster });
})();
</script>
<h1>Your headline here</h1>
</section>
For the angled edge, give the section a height and a clip-path. Keep your content above the gradient with position: relative:
.hero {
position: relative;
min-height: 80vh;
clip-path: polygon(0 0, 100% 0, 100% 78%, 0 100%);
}
.hero h1 { position: relative; }
In React, the exported MeshBackground component takes the same styles:
<MeshBackground style={{ minHeight: '80vh', clipPath: 'polygon(0 0, 100% 0, 100% 78%, 0 100%)' }}>
<h1>Your headline here</h1>
</MeshBackground>
More on the component, Next.js and props in the React guide.
Ready for production
- Small. The runtime is about 19 KB gzipped, with no dependencies, MIT licensed.
- Kind to weak devices. Below 24 fps it lowers its resolution; if a device stays below 15 fps for 4 seconds it holds a still frame.
- Accessible. With
prefers-reduced-motionit shows a still frame, and without WebGL2 it shows the poster image. - Yours. Exported code never checks a license and never calls home — it keeps working offline, forever.