uibrik

Halftone

Preview

Customize

Colors
Background
Spacing7.0px
Dot size0.95
Min dot0.30
Angle0°
Frequency1.30
Flow1.20
Band width1.00
Contrast1.10
Glow0.50
Softness0.00
Fade0.00
edges
Speed1.0
Seed0
Radius70px
Trail strength0.85
Trail length0.90s
Follow0.55

Usage

import { Halftone } from "@/components/uibrik/halftone/halftone";

<Halftone />

Installation

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

Props

Halftone
colors
Type string[]
["#1b2533","#5c7a9a","#c9d6e0","#f6ecdc"]
Dot colours from dim to bright, blended in OKLCH; 2 to 6.
background
Type string
"#050608"
Colour behind the dots.
spacing
Type number
7
Distance between dots.
dotSize
Type number
0.95
Largest dot, as a share of the spacing; 1 lets the brightest dots touch.
minDot
Type number
0.3
Smallest dot (in the dark), as a share of the largest; 0 lets dark dots vanish.
angle
Type number
0
Grid angle.
frequency
Type number
1.3
Size of the ribbons of light; higher is busier.
flow
Type number
1.2
How much the ribbons curl.
bandWidth
Type number
1
Thickness of the ribbons.
contrast
Type number
1.1
Higher gives darker darks and fuller lights.
glow
Type number
0.5
Light spilling around the brightest dots.
softness
Type number
0
Blur on each dot's edge.
fade
Type number
0
How much the dots fade out toward the chosen side.
fadeFrom
Type "edges" | "top" | "bottom" | "left" | "right"
"edges"
Where the dots fade out.
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
70
Width of the pointer trail.
trailStrength
Type number
0.85
How strongly the trail lights the dots.
trailLength
Type number
0.9
Seconds the trail takes to fade.
follow
Type number
0.55
How lazily the trail 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.