# Caustics

> Sunlight on a pool floor, from light rays bent by moving water; click to drop a ripple.

## Spec sheet

| | |
| --- | --- |
| Access | Free: no account, free for commercial use |
| Shelf | Backgrounds › Backgrounds |
| Live preview | https://uibrik.com/components/caustics |
| Writes | 1 files into `components/uibrik/caustics/`, plus `components/uibrik/_shader-background/ShaderSurface.tsx` |
| Packages | none beyond React |
| Needs | React 19, Tailwind CSS v4, a project set up with `npx shadcn@latest init` |
| Theme | Reads the shadcn tokens and follows class-based dark mode ([theming](https://uibrik.com/docs/theming.md)) |
| Updated | Nov 26, 2026 |

## Add it

```bash
npx shadcn@latest add https://uibrik.com/r/caustics.json
```

With the `@uibrik` namespace in `components.json` ([setup](https://uibrik.com/docs/installation.md)): `npx shadcn@latest add @uibrik/caustics`.

Can't run commands? https://uibrik.com/components/caustics/prompt-full.txt has every file verbatim, with the setup steps, ready for an assistant to write.

## Render it

Renders as is; every value shown is the default, so delete any line you don't need.

```tsx
import { Caustics } from "@/components/uibrik/caustics/caustics";

<Caustics
  colors={["#0b3a53", "#0f6f8f", "#3fb6c9", "#e6fbff"]}
  strength={0.6}
  waves={0.35}
  depth={1.4}
  scale={1}
  dispersion={0.5}
  chop={0.55}
  direction={23}
  softness={0.05}
  bloom={1.1}
  sparkle={1.25}
  sparkleSize={1}
  rayAngle={70}
  vignette={0.25}
  shade={0.8}
  speed={1}
  grain={0.015}
  seed={0}
  animate
  interactive
  follow={0.75}
  touch={0.5}
  ripples
  rippleStrength={0.35}
  rippleSize={1}
  rippleSpeed={1}
>
  …
</Caustics>
```

## Tune it

The same props as the Customize panel on https://uibrik.com/components/caustics.

| Prop | Type | Default | What it does |
| --- | --- | --- | --- |
| `colors` | `string[]` | `["#0b3a53","#0f6f8f","#3fb6c9","#e6fbff"]` | Pool floor from deep to shallow, then the light's tint last; 2 to 6 colours. |
| `strength` | `number` | `0.6` | How strong the light is against the plain floor. |
| `waves` | `number` | `0.35` | Wave height. |
| `depth` | `number` | `1.4` | Floor depth: deeper water focuses the light into thinner, brighter lines. |
| `scale` | `number` | `1` | Size of the waves; larger is calmer. |
| `dispersion` | `number` | `0.5` | Colour fringing at the edges of the light. |
| `chop` | `number` | `0.55` | Irregular chop on top of the wave trains; 0 leaves only smooth swells. |
| `direction` | `number` | `23` | Direction the main waves travel. |
| `softness` | `number` | `0.05` | Blur on the light, like a larger sun. |
| `bloom` | `number` | `1.1` | Glow spilling around the brightest light. |
| `sparkle` | `number` | `1.25` | Star-shaped sun glints where the light peaks. |
| `sparkleSize` | `number` | `1` | Length of the glint rays. |
| `rayAngle` | `number` | `70` | Direction of the long glint rays. |
| `vignette` | `number` | `0.25` | Darkening toward the corners. |
| `shade` | `number` | `0.8` | How much the floor colour varies. |
| `speed` | `number` | `1` | Animation speed; 1 is the designed pace. |
| `grain` | `number` | `0.015` | Film grain strength. |
| `seed` | `number` | `0` | Shifts the composition, so two backgrounds with the same settings still differ. |
| `animate` | `boolean` | `true` | Move on its own. Off draws one still frame. |
| `interactive` | `boolean` | `true` | React to the pointer. |
| `follow` | `number` | `0.75` | How lazily the fingertip dip follows the pointer, 0 (locked) to 1 (drifts after it). |
| `touch` | `number` | `0.5` | How deep the pointer dips into the water. |
| `ripples` | `boolean` | `true` | A click drops a ripple on the water. |
| `rippleStrength` | `number` | `0.35` | Height of a click ripple. |
| `rippleSize` | `number` | `1` | Wavelength of a click ripple; larger is broader. |
| `rippleSpeed` | `number` | `1` | How fast a ripple spreads. |

## Wire it

The props the Customize panel doesn't show: ranges, data, content and callbacks.

| Prop | Type | Default | What it does |
| --- | --- | --- | --- |
| `children` | `ReactNode` |  | Content shown on top of the background. |
| `className` | `string` |  | Classes for the box; it fills whatever size you give it. |

## Where it fits

- **Travel and hotel sites**: Sunlight on a pool floor sets a summer, holiday mood behind a booking or destination page.
- **Wellness app heroes**: Slow moving water light gives a spa or meditation product a calm, living backdrop. Pairs with [Soft Clouds](https://uibrik.com/components/soft-clouds.md) (Pro).
- **Summer campaigns**: Click-to-ripple adds a small moment of play to seasonal landing pages.

## Same shelf: Backgrounds

- [Chladni Sand](https://uibrik.com/components/chladni-sand.md) (Pro): Sand on a vibrating plate settling into its resonance figures, then dancing into the next note; click to change the note.
- [Column Gradient](https://uibrik.com/components/column-gradient.md) (Pro): A soft, grainy gradient seen through wide glass columns, each slid along by its own amount; the pointer is a light that glints down the ribs and drags the columns it passes.
- [Diagonal Beams](https://uibrik.com/components/diagonal-beams.md): One soft light falling across sharp, slanted pleats in the dark, its edge dissolving into fine grain.
- [Dither Gradient](https://uibrik.com/components/dither-gradient.md): A bending gradient drawn only in your colours through an ordered dither.
- [Dot Grid](https://uibrik.com/components/dot-grid.md): A quiet grid of dots lit by a drifting wave and by the cursor.
- [Fluted Glass](https://uibrik.com/components/fluted-glass.md) (Pro): A band of light seen through fluted glass, broken into steep slivers rib by rib.

## Ground rules

- Only the props above exist. To change anything else, edit the installed file.
- Keep the files in `components/uibrik/caustics/` so the import paths keep resolving.
- The playbook for working with the whole library: https://uibrik.com/llms.txt
