uibrik

Dither Gradient

Preview

Customize

Colors
Pixel size3px
Scale1.00
Warp1.00
Angle90°
Sweep0.60
Speed1.0
Seed0
Radius180px
Follow0.60

Usage

import { DitherGradient } from "@/components/uibrik/dither-gradient/dither-gradient";

<DitherGradient />

Installation

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

Props

DitherGradient
colors
Type string[]
["#0f172a","#4338ca","#db2777","#fbbf24"]
The only colours drawn, in order; 2 to 6.
pixelSize
Type number
3
Size of a dither pixel; larger is more retro.
scale
Type number
1
Size of the shapes; larger is calmer.
warp
Type number
1
How much the gradient bends.
angle
Type number
90
Direction the colours run; 90 runs bottom to top.
sweep
Type number
0.6
How far apart the first and last colours sit.
speed
Type number
1
Animation speed; 1 is the designed pace.
seed
Type number
0
Shifts the composition, so two backgrounds with the same settings still differ.
animate
Type boolean
true
Move on its own. Off draws one still frame.
interactive
Type boolean
true
React to the pointer.
radius
Type number
180
How far the pointer light reaches.
follow
Type number
0.6
How lazily the light follows the pointer, 0 (locked) to 1 (drifts after it).
children
Type ReactNode
–
Content shown on top of the background.
className
Type string
–
Classes for the box; it fills whatever size you give it.