FX · Backgrounds

Four soft colour fields drifting around each other: a living gradient mesh.

Living colour

bash
npx shadcn@latest add https://www.rad-ui.com/r/mesh-gradient.json
React
import MeshGradient from "@/components/fx/mesh-gradient" <MeshGradient className="px-8 py-24"> <h2>Your content</h2> </MeshGradient>
  • The effect layer is aria-hidden and ignores pointer events; only children are exposed.
  • Check text contrast against the brightest blend of colours.
  • Pauses offscreen; `paused` stops it on demand (wire it to a visible control if it runs behind reading content).
  • prefers-reduced-motion: reduce (or data-rad-fx-motion="reduce" on an ancestor) holds the mesh still.
PropTypeDefaultDescription
colors
[string × 4]
indigo, pink, cyan, violet

One colour per corner.

speed
number
16

Seconds per drift cycle.

paused
boolean
false

Stop the animation. It also pauses offscreen.

...props
ComponentProps<'div'>
—

Passed to the root div; children render above.