affectUI › Motion › Backgrounds
Lagoon Gradient
A calm, watery backdrop of folded colour drawn live in WebGL that keeps its colour evenly spread, with its own dark-mode version.
Part of affectUI Pro. Install: npx shadcn@latest add https://www.affectui.com/r/lagoon-gradient.json · Import from @/components/ui/lagoon-gradient
When to use
- Hero sections, case-study cards or call-to-action blocks that need a calm, living backdrop
- Behind a headline or a short quote, where the colour should feel alive but never busy
When not to use
- Behind long body text – keep text in the faded upper part or on a card
- Many gradients on one screen – each one draws its own WebGL canvas
Usage
import { LagoonGradient } from "@/components/ui/lagoon-gradient";
export function Hero() {
return (
// Give the gradient a height, e.g. with a class
<LagoonGradient className="hero">
<h1>Ideas that flow</h1>
</LagoonGradient>
);
}Props
| Name | Type | Default | Description |
|---|---|---|---|
children | ReactNode | Content rendered above the gradient | |
colors | [string, string, string, string, string] | Own colours: paper, light, mid, deep, accent. Paper should match the background | |
speed | number | 20 | Seconds per loop; 0 keeps a still frame |
fade | number | 1 | How strongly the colour fades into the paper towards the top, 0–1 |
intensity | number | 0.75 | How strong the colour is, 0–1 |
className | string | Extra class on the root, e.g. for height or rounded corners | |
style | CSSProperties | Inline styles on the root |
Accessibility
- The canvas and its fallback are hidden from screen readers; only your children are announced
- Keep text in the faded upper part, where the paper colour gives it full contrast
Responsive
- Fills its container – give the root a height; the blur grows with the width
- Set the colours with --ui-lgr-paper, --ui-lgr-light, --ui-lgr-mid, --ui-lgr-deep and --ui-lgr-accent; dark mode has its own set
Requirements
- React 19
- WebGL (falls back to a CSS gradient without it)
Related
- Iris Gradient – A soft, dreamy backdrop of folded colour drawn live in WebGL that keeps its colour evenly spread, with its own dark-mode version
- Apricot Gradient – A warm, glowing backdrop of folded colour drawn live in WebGL that keeps its colour evenly spread, with its own dark-mode version
- Gradient Floor – A blurred colour gradient that glows up from the bottom edge – two layers that drift and morph