Sections / Gems / Generative backgrounds
Caustics
Sunlight through moving water, thrown on the wall behind your hero in your own three colours. The light is worked out from the curvature of a seeded water surface, so the bright filaments gather, split and re-form the way real pool light does, with a hint of colour at their edges. The pointer drops rings into the water that bend the light as they spread. One small WebGL shader, no dependencies.
- Kind
- Generative backgrounds
- Interaction
- autoplay · pointer rings · generative · WebGL · pause button · seeded
- Dependencies
- None
- Licence
- Free for personal and commercial sites; do not resell the gem itself
Formats
- Webflow (native)
- Figma (layers)
- Framer component
- HTML
- Prompts for Claude Code, Cursor, Lovable, v0, Bolt
Copy to Webflow pastes a native section with the gem in an Embed inside it. Copy to Figma pastes a frame of its best moment, text and controls as layers. Copy to Framer pastes a component with its options as controls. HTML is one self-contained snippet. Each prompt (Claude Code, Cursor, Lovable, v0, Bolt) carries the exact files, so your agent installs this gem, not a lookalike. With the MCP server, ask your agent for get_section("caustics").
Behaviour and accessibility
- The same seed always gives the same water, so the light looks the same on every visit and every device.
- A labelled pause button (aria-pressed) stills the water for anyone who wants stillness; the water itself is decorative and hidden from screen readers.
- Drawing stops entirely off screen or in a background tab; the light renders at a capped pixel count and the browser scales it up, which the soft pattern does not show.
- With prefers-reduced-motion: one still frame, no colour split, no rings and no pause button. Without WebGL it falls back to a still gradient in the same colours.
- Anything you put inside the element (a headline, buttons) sits above the water in a .cst-content layer.
Options
| Option | Type | Default | What |
|---|---|---|---|
palette | [string, string, string] | 3 built in | Three colours: the deep water, the lit wall, the caustic light. |
scale | number | 150 | Size of the pattern: px per light cell, roughly. Bigger is calmer. |
focus | number | 1 | How hard the water focuses the light. 1 is clear summer water; lower is softer, higher is sharper. |
dispersion | number | 0.35 | Colour split at the bright filaments. 0 turns it off. |
speed | number | 1 | Time scale: 1 is a slow swell, 2 twice as fast. |
pointer | boolean | true | The pointer drops rings into the water (mouse and pen). |
controls | boolean | true | Show the pause button. |
seed | number | 3 | Seed for the waves: the same seed gives the same water. |
onPause | (paused: boolean) => void | Called when the water is paused or played with the button or the handle. |



