Sunlight through leaves on a warm wall: soft round spots of sun open and close as the canopy sways, and leaf shadows drift across. Komorebi, in a shader.
Warm light seeping into a film frame: orange and rose blooms drift in from the edges and fade, a burn streak flares across, and fine grain flickers over it all.
Customize
Usage
import { LightLeak } from "@/components/motionkit/light-leak";
<LightLeak
className="h-[32rem]"
>
<h1>Your hero</h1>
</LightLeak>Motion
The exact curves this component runs, plotted with Motion's own maths.
Leaks bloom
Runs on its own
Burn streak
Runs on its own
Grain flicker
Runs on its own
Photography, film and music sites, fashion and lifestyle brands, and any hero that should feel warm, nostalgic and shot on film.
Three large radial gradients sit just outside the edges of the frame with a screen blend. A keyframe moves each one inwards while it brightens and fades, offset so there's always one blooming. A blurred band of warm light sweeps across now and then for the burn streak, and a tile of SVG noise jumps between positions a few times a second with an overlay blend for the flicker of grain. A radial vignette darkens the corners. Everything is transform and opacity, so the browser animates it on the GPU.
Works in the App Router as is. Requires Tailwind CSS v4.
One command adds the file and installs its dependencies. Needs a components.json (run npx shadcn@latest init once if you don't have one).
npx shadcn@latest add https://www.motionkitui.com/r/light-leak.jsonnpm install motionSave as components/motionkit/light-leak.tsx.
"use client";
import type { CSSProperties, ReactNode } from "react";
type LightLeakProps = {
children?: ReactNode;
/** Three warm colours for the leaks and the burn. */
colors?: [string, string, string];
/** Colour underneath. */
background?: string;
/** 0 to 0.5. How visible the film grain is. */
grain?: number;
/** Seconds for each leak to bloom and fade. */
duration?: number;
/** Darken the corners, as an old lens does. */
vignette?: boolean;
className?: string;
};
const NOISE =
"url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E\")";
// where each leak blooms from and drifts to, so light seems to seep in round the edge of the frame
const LEAKS = [
{ box: "-left-[20%] -top-[25%] h-[90%] w-[70%]", from: "-8%, -6%", to: "6%, 4%", color: 0, peak: 0.95, offset: 0 },
{ box: "-right-[25%] top-[10%] h-[100%] w-[65%]", from: "10%, 0%", to: "-4%, 6%", color: 2, peak: 0.85, offset: 0.33 },
{ box: "-bottom-[30%] left-[15%] h-[80%] w-[80%]", from: "0%, 12%", to: "-6%, -2%", color: 1, peak: 0.85, offset: 0.66 },
] as const;
/**
* Warm light seeping into a film frame: blooms of orange and rose drift in from the edges, burn bright and fade, a
* streak flares across now and then, and fine grain flickers over it all. Pure CSS, so it costs next to nothing.
*/
export function LightLeak({ children, colors = ["#FF8A4C", "#FFC46B", "#E2557A"], background = "#0C1010", grain = 0.18, duration = 14, vignette = true, className = "" }: LightLeakProps) {
return (
<div data-leak="" className={`relative isolate overflow-hidden ${className}`} style={{ backgroundColor: background }}>
<style>{`
@keyframes leak-bloom{0%{opacity:0;transform:translate3d(var(--leak-from),0) scale(.85)}35%{opacity:var(--leak-peak)}60%{opacity:calc(var(--leak-peak)*.55)}100%{opacity:0;transform:translate3d(var(--leak-to),0) scale(1.15)}}
@keyframes leak-burn{0%,62%{transform:translateX(-60%) skewX(-10deg);opacity:0}70%{opacity:.8}84%{opacity:.35}100%{transform:translateX(560%) skewX(-10deg);opacity:0}}
@keyframes leak-grain{0%{transform:translate(0,0)}20%{transform:translate(-4%,3%)}40%{transform:translate(3%,-5%)}60%{transform:translate(-2%,6%)}80%{transform:translate(5%,-2%)}100%{transform:translate(0,0)}}
@media (prefers-reduced-motion:reduce){[data-leak] [data-leak-layer]{animation:none!important;opacity:calc(var(--leak-peak,.6)*.6)!important}[data-leak] [data-leak-burn]{display:none}}
`}</style>
{LEAKS.map((leak, index) => (
<div
key={index}
aria-hidden
data-leak-layer=""
className={`pointer-events-none absolute -z-10 rounded-full mix-blend-screen ${leak.box}`}
style={
{
background: `radial-gradient(closest-side, ${colors[leak.color]}, color-mix(in srgb, ${colors[leak.color]} 40%, transparent) 50%, transparent)`,
"--leak-from": leak.from,
"--leak-to": leak.to,
"--leak-peak": leak.peak,
opacity: 0,
animation: `leak-bloom ${duration}s ease-in-out ${-leak.offset * duration}s infinite`,
willChange: "transform, opacity",
} as CSSProperties
}
/>
))}
{/* a burn streak, as when the film runs past a gap in the camera */}
<div
aria-hidden
data-leak-layer=""
data-leak-burn=""
className="pointer-events-none absolute inset-y-[-10%] left-0 -z-10 w-[22%] mix-blend-screen"
style={{
background: `linear-gradient(90deg, transparent, color-mix(in srgb, ${colors[1]} 55%, transparent) 35%, rgb(255 244 225 / 0.55) 50%, color-mix(in srgb, ${colors[2]} 50%, transparent) 65%, transparent)`,
filter: "blur(18px)",
opacity: 0,
animation: `leak-burn ${duration * 1.4}s ease-in-out ${-duration * 0.2}s infinite`,
willChange: "transform, opacity",
}}
/>
{grain > 0 && (
<div
aria-hidden
data-leak-layer=""
className="pointer-events-none absolute -inset-[20%] -z-10 mix-blend-overlay"
style={{ backgroundImage: NOISE, opacity: grain * 1.6, animation: "leak-grain 0.7s steps(5) infinite" }}
/>
)}
{vignette && <div aria-hidden className="pointer-events-none absolute inset-0 -z-10" style={{ background: "radial-gradient(ellipse at center, transparent 45%, rgb(0 0 0 / 0.55) 100%)" }} />}
{children}
</div>
);
}
| Prop | Type | Default | Description |
|---|---|---|---|
| children | ReactNode | — | Your content, layered above the leaks. |
| colors | [string, string, string] | orange, amber, rose | Colours of the leaks and the burn. |
| background | string | "#0C1010" | Colour underneath. |
| grain | number | 0.18 | How visible the film grain is, 0 to 0.5. |
| duration | number | 14 | Seconds for each leak to bloom and fade. |
| vignette | boolean | true | Darken the corners, like an old lens. |
How we audit: the WCAG 2.2 animation checklist and respecting reduced motion in React.
Yes. The file starts with "use client", so you can import it straight into a Server Component page or layout. It works in Vite as is, and in Astro as a React island.
Nothing beyond React and Tailwind CSS v4. There is no MotionKit package and no Tailwind config to add.
Yes. Run npx shadcn@latest add https://www.motionkitui.com/r/light-leak.json in any project with a components.json. It saves the file to components/motionkit and installs its dependencies.
With reduced motion on, the leaks rest as a soft still glow, the streak is removed and the grain stops.
Sunlight through leaves on a warm wall: soft round spots of sun open and close as the canopy sways, and leaf shadows drift across. Komorebi, in a shader.
Op-art interference: two fine patterns overlap and one drifts, so large ghostly bands ripple through them that neither layer contains.
A wall of frosted glass tiles over slowly drifting colour: soft, bright light inside each pane, sharp colour in the gaps, and a glint where the pointer is.
Summer, on film