DocsGrain Gradient

Grain Gradient

A softly curved color field with fine film grain. Breathing light and flowing shadows, with customizable palette, composition, texture, and motion.

Installation

pnpm dlx shadcn@latest add @componentry/grain-gradient

Usage

Set a height on the component or its parent. This decorative surface is hidden from assistive technology; place any content in a separate layer. Colors accept three- or six-digit hex values and stay the same in either theme. WebGL is optional: a CSS gradient appears when unavailable. Motion pauses offscreen, in hidden tabs, and with reduced motion. The default gently breathes; set speed to zero to pause.

import { GrainGradient } from "@/components/ui/grain-gradient"

<GrainGradient
  colorLight="#dce5df"
  colorMid="#83b9ad"
  colorDark="#031419"
  speed={1}
  grain={0.32}
  className="h-[560px] rounded-2xl"
/>

API Reference

PropTypeDefault
colorLightstring"#dce5df"
colorMidstring"#83b9ad"
colorDarkstring"#031419"
anglenumber0
positionnumber0
curvenumber0.48
softnessnumber0.13
scalenumber1
grainnumber0.32
grainSizenumber1
seednumber1
speednumber0
classNamestring—
styleCSSProperties—

Keep in mind

This component is inspired by various open-source projects and patterns. Please verify licenses and implementation details before using in production.

Need a custom component?

I build bespoke UI components & websites tailored to your brand.

DM me on X
PreviousDither Prism HeroNextHero Geometric