affectUI › Motion › Backgrounds

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.

Part of affectUI Pro. Install: npx shadcn@latest add https://www.affectui.com/r/iris-gradient.json · Import from @/components/ui/iris-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 { IrisGradient } from "@/components/ui/iris-gradient";

export function Hero() {
  return (
    // Give the gradient a height, e.g. with a class
    <IrisGradient className="hero">
      <h1>Ideas that flow</h1>
    </IrisGradient>
  );
}

Props

NameTypeDefaultDescription
childrenReactNodeContent rendered above the gradient
colors[string, string, string, string, string]Own colours: paper, light, mid, deep, accent. Paper should match the background
speednumber20Seconds per loop; 0 keeps a still frame
fadenumber1How strongly the colour fades into the paper towards the top, 0–1
intensitynumber0.75How strong the colour is, 0–1
classNamestringExtra class on the root, e.g. for height or rounded corners
styleCSSPropertiesInline 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-irg-paper, --ui-irg-light, --ui-irg-mid, --ui-irg-deep and --ui-irg-accent; dark mode has its own set

Requirements

  • React 19
  • WebGL (falls back to a CSS gradient without it)

Related

  • 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
  • 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