React Hero Section with Animated WebGL Clouds
ProA calm, centred hero set in the sky. Soft white clouds drift slowly across a blue gradient in light mode, or through a deep night blue in dark mode, while a two line headline, a short paragraph and two buttons fade in above them.

Moving clouds in a few kilobytes
Hero Section with Animated Clouds is a React and Tailwind CSS hero section with an animated cloud background drawn by a fragment shader in raw WebGL, so the sky moves continuously without a video file or a 3D library. It works in Next.js or any React project.
Cloud backgrounds usually arrive as looping videos, which are heavy and visibly repeat, or as Three.js scenes, which pull in a large library for one effect. This block writes one full screen quad and a small shader directly against WebGL. Heavy cumulus banks rise from the bottom corners, thin wisps drift across the top, and the middle stays open sky for the copy. The noise keeps reshaping as it moves, so the sky never loops.
The sky follows your theme: a deep blue day with white clouds, or a navy night with moonlit grey clouds. Each scheme takes four colours, two for the sky and two for the lit and shaded sides of the clouds.
What is on screen
Shader sky
Layered gradient noise is carved into rounded lobes, then each lobe is lit from the upper right by sampling the field one step toward the sun, so tops read bright and folds read shaded. Changing the palette only updates uniforms; the shader is never recompiled.
Open centre
Cloud cover is weighted toward the bottom corners and the top edges, so the band behind the headline and buttons stays clear sky and the text needs no overlay to stay readable.
Centred copy
Headline split on a newline, a paragraph up to 860px wide and two buttons, arriving with a staggered Framer Motion fade: the headline first, then the paragraph, then the buttons.
Instant first paint
The section background is a CSS gradient in the same sky colours, so visitors see the sky before WebGL draws, and the clouds fade in on their first frame. Without WebGL the gradient simply stays.
When clouds make sense
Use it when
- Cloud, deployment and infrastructure products where the metaphor fits the pitch.
- Calm, friendly brands such as wellbeing, travel or education.
- You want an animated hero without adding Three.js to the bundle.
- Your site switches between light and dark and the hero should feel like day and night.
Skip it when
- The hero has to look identical in a screenshot tool or an email, where a live canvas will not run.
- A bright, busy hero would clash with the product screenshots that follow.
- Your brand palette has no sky tones and you do not want to retune four colours per theme.
Set the copy and the sky
Pass headline, subtext and the two calls to action, then tune the sky. speed multiplies the drift, so 0.5 halves it. lightPalette and darkPalette each take skyTop, skyBottom, cloudLight and cloudShadow, and any you leave out keep their defaults. Force a scheme with theme when the hero always sits on one background regardless of the site setting.
The block is a single file with its theme and motion hooks inside it, so there is no helper to keep alongside it.
npx wensity@latest add hero-section-with-animated-clouds --type block
import { CloudySundayHero } from "@/components/wensity/blocks/hero-section-with-animated-clouds";export default function Page() {return (<CloudySundayHeroheadline={"Releases without\nthe weather."}subtext="Preview every change, roll out gradually and roll back in one click."primaryCta={{ label: "Deploy free", href: "/signup" }}secondaryCta={{ label: "See how it works", href: "/tour" }}speed={0.6}lightPalette={{ skyTop: "#2563eb", skyBottom: "#7dd3fc" }}/>);}
Props
| Prop | Type | Default | Description |
|---|---|---|---|
headline | string | "Take your launch\nabove the clouds." | Centred title. Use a newline to control the break. |
speed | number | 1 | Multiplier on cloud drift. Below 1 for a calmer sky. |
lightPalette | { skyTop; skyBottom; cloudLight; cloudShadow } | - | Day colours. Default is a deep to light blue sky with white clouds. |
darkPalette | { skyTop; skyBottom; cloudLight; cloudShadow } | - | Night colours. Default is a navy sky with moonlit grey clouds. |
theme | "auto" | "light" | "dark" | "auto" | auto follows the site theme. Force day or night if you prefer. |
respectReducedMotion | boolean | true | Pauses the drift for visitors who ask for reduced motion. Leave it on. |
Rendering and motion notes
Reduced motion pauses the sky
With respectReducedMotion on, the shader stops for visitors who prefer reduced motion. The Framer Motion entrance of the copy is not covered by that setting; wrap the hero in MotionConfig with reducedMotion set to user to cover it.
Stops when it is not needed
An IntersectionObserver stops the loop once the hero leaves the viewport, and the frame holds still while the page is scrolling so the GPU is free for the scroll. The clouds move too slowly for either pause to show.
Light on the GPU
The clouds are soft, so the canvas renders at 0.6x of its CSS size and the browser scales it up, drawing at 30 frames per second on the low power GPU. That is a small fraction of a full resolution shader at 60 frames per second, with no visible difference.
No 3D library
Raw WebGL plus Framer Motion for the text. There is no Three.js to install for this hero.
Block details
- Category
- Hero Sections
- Renders
- WebGL canvas. Compiles a shader before the first frame
- Theme
- Follows the site theme in light and dark
- Dependencies
clsxframer-motionnext-themestailwind-merge- Source
- 588 lines, 23 KB in one file
- Install
wensity add hero-section-with-animated-clouds --type block- Tags
- light, dark, webgl, shader, clouds, sky, centered
- Last updated

