A softly curved color field with fine film grain. Breathing light and flowing shadows, with customizable palette, composition, texture, and motion.
pnpm dlx shadcn@latest add @componentry/grain-gradientDependencies: clsx tailwind-merge
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"
/>| Prop | Type | Default |
|---|---|---|
colorLight | stringPale highlight color (hex). | "#dce5df" |
colorMid | stringUpper-left wash and diffused edge color (hex). | "#83b9ad" |
colorDark | stringDeep shadow color (hex). | "#031419" |
angle | numberComposition rotation in degrees, -360 to 360. | 0 |
position | numberHorizontal edge offset, -1 to 1. | 0 |
curve | numberShadow edge curvature, -1 to 1. | 0.48 |
softness | numberEdge diffusion width, 0.01 to 1. | 0.13 |
scale | numberComposition zoom, 0.25 to 3. | 1 |
grain | numberFilm grain intensity, 0 to 1. Zero removes the texture. | 0.32 |
grainSize | numberGrain size in CSS pixels, 0.5 to 4. | 1 |
seed | numberReproducible texture seed, 0 to 100000. | 1 |
speed | numberBreathing speed, 0 to 2. At 1, the primary cycle lasts about 12 seconds. Zero pauses on the current frame. | 0 |
className | stringContainer sizing, rounding, and styling. | — |
style | CSSPropertiesInline container styles. | — |
Keep in mind
Need a custom component?
I build bespoke UI components & websites tailored to your brand.