Smoke
A WebGL2 shader of smoke curling up from the edge of a section, with a ragged, domain-warped front.
Props
From
Color
#ef4444
Rise0.50
Scale1.10
Speed1.00
Strength1.00
Installation
pnpm dlx shadcn@latest add @breeze/smokeUsage
import { Smoke } from "@/components/breeze/smoke"It sits behind a hero or the bottom of a page. Where there's no smoke the canvas is transparent, so your background shows through. A mask softens the box's far edge.
<section className="relative isolate overflow-hidden">
<Smoke className="absolute inset-x-0 bottom-0 -z-10 h-[min(100svh,760px)] w-full [mask-image:linear-gradient(to_top,black_55%,transparent)]" />
{/* content */}
</section>Props
| Prop | Type | Default | Description |
|---|---|---|---|
color | string | "#ef4444" | Smoke colour, any CSS colour or var() |
from | "bottom" | "top" | "bottom" | The edge the smoke rises from |
rise | number | 0.5 | How far the smoke reaches into the box, 0 to 1 |
scale | number | 1.1 | Size of the swirls. Higher is finer |
speed | number | 1 | Animation speed multiplier. 0 freezes the smoke |
strength | number | 1 | Opacity multiplier |
fps | number | 30 | Frame rate cap |
Every prop updates live without restarting the animation. In dark mode the smoke is deep in the body with bright crests. In light mode it's a wash of the colour that thickens toward the crests, with deeper ink in the folds. It draws at half resolution, fades in once it has drawn, pauses off-screen and shows a still frame with reduced motion.
Examples
From both edges
<Smoke from="top" rise={0.35} strength={0.7} className="absolute inset-0 h-full w-full" />
<Smoke rise={0.4} className="absolute inset-0 h-full w-full" />