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/smoke

Usage

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

PropTypeDefaultDescription
colorstring"#ef4444"Smoke colour, any CSS colour or var()
from"bottom" | "top""bottom"The edge the smoke rises from
risenumber0.5How far the smoke reaches into the box, 0 to 1
scalenumber1.1Size of the swirls. Higher is finer
speednumber1Animation speed multiplier. 0 freezes the smoke
strengthnumber1Opacity multiplier
fpsnumber30Frame 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