Black Friday: 30% off Pro

Get 30% off

Updated

Grain Gradient

Preview

Customize

Colors
Scale1.00
Warp1.00
Sheen0.60
Angle30°
Sweep0.70
Vignette0.50
Speed1.0
Grain0.080
Grain size1.0px
Seed0
Twist1.00

Installation

npx shadcn@latest add https://uibrik.com/r/grain-gradient.json
Adds the files to components/uibrik/grain-gradient. With the @uibrik namespace set up: npx shadcn@latest add @uibrik/grain-gradient.

Too large to paste whole, so Copy prompt gives a short prompt that installs it with the CLI. Download the full prompt to attach it instead.

Usage

import { GrainGradient } from "@/components/uibrik/grain-gradient/grain-gradient";​const colors = ["#07142e", "#123a7c", "#2b6bd6", "#7db4f2", "#dcebfc"];​<GrainGradient  colors={colors}  scale={1}  warp={1}  sheen={0.6}  angle={30}  sweep={0.7}  vignette={0.5}  speed={1}  grain={0.08}  grainSize={1}  seed={0}  interactive  twist={1}  animate>  …</GrainGradient>

Where to use Grain Gradient

  • Warm hero backgrounds

    Colour folding like silk with film grain adds warmth behind a headline.

    Pairs with Mesh Gradient

  • Campaign pages

    A slow shifting gradient in brand shades gives seasonal pages a premium finish.

  • Music and fashion sites

    Grain gives the gradient a printed, analogue texture suited to creative brands.

    Pairs with Oil Slick

Props

GrainGradient
colors
Type string[]
["#07142e","#123a7c","#2b6bd6","#7db4f2","#dcebfc"]
Hex colours, 2 to 6, laid out from first to last across the flow.
scale
Type number
1
Size of the shapes; larger is calmer.
warp
Type number
1
How much the flow folds into itself.
sheen
Type number
0.6
Soft light on the folds.
angle
Type number
30
Direction the colours run; 0 is left to right.
sweep
Type number
0.7
How far apart the first and last colours sit; 0 mixes them all evenly.
vignette
Type number
0.5
Darkening toward the corners.
speed
Type number
1
Animation speed; 1 is the designed pace.
grain
Type number
0.08
Film grain strength.
grainSize
Type number
1
Size of a grain speck.
seed
Type number
0
Shifts the composition, so two backgrounds with the same settings still differ.
interactive
Type boolean
true
Twist the silk with the pointer.
twist
Type number
1
How strongly the pointer twists the silk.
animate
Type boolean
true
Move on its own. Off draws one still frame.
children
Type ReactNode
–
Content shown on top of the background.
className
Type string
–
Classes for the box; it fills whatever size you give it.