23rd logo23rd

Shader Gradient

A grainy, flowing WebGL gradient that follows the theme and swirls around the pointer.

Preview

Installation

pnpm dlx shadcn@latest add @23rd/shader-gradient

Or from the public GitHub registry:

pnpm dlx shadcn@latest add radiumcoders/23rd.dev/shader-gradient

Usage

Pin it behind a relatively positioned section, with content in relative z-10.

"use client"

import { ShaderGradient } from "@/components/ui/shader-gradient"

export function Hero() {
  return (
    <section className="relative isolate min-h-svh overflow-hidden bg-background">
      <ShaderGradient />
      <div className="relative z-10 mx-auto flex min-h-svh max-w-xl flex-col items-center justify-center px-6 text-center">
        <p className="text-xs font-medium tracking-[0.18em] text-muted-foreground uppercase">
          New
        </p>
        <h1 className="mt-3 text-4xl font-medium tracking-tight">
          Ship the page, not the backdrop
        </h1>
        <p className="mt-3 text-muted-foreground">
          Headline, proof, and a primary action sit on the wash. The shader
          stays quiet.
        </p>
      </div>
    </section>
  )
}

Lock the theme:

<ShaderGradient theme="light" />
<ShaderGradient theme="dark" />

Props

PropTypeDefault
colorsstring[]theme palette, up to 4
speednumber0.14
blurnumber0.7, 0–1
intensitynumber0.95, 0–1
grainnumber0.35, 0–1, 0 for none
interactivebooleantrue
theme"light" | "dark" | "auto"auto
classNamestringReact only
classstringSvelte only