uibrik

Dot Grid

Preview

Customize

Colors
Dot color
Background
circle
grid
Spacing20px
Size2.5px
Intensity0.70
Twinkle0.50
Glow0.60
Ambient0.50
Fade1.00
Speed1.0
Grain0.000
Seed0
Radius160px
Follow0.60
Trail0.60
Magnify0.50

Usage

import { DotGrid } from "@/components/uibrik/dot-grid/dot-grid";

<DotGrid />

Installation

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

Props

DotGrid
colors
Type string[]
["#2fb4d2","#3a9ef2","#5a82ea","#34c1b0"]
Colours the dots light up in, 2 to 6.
dotColor
Type string
""
Resting dot colour; empty follows the theme.
background
Type string
""
Base colour behind the dots; empty follows the page.
shape
Type "circle" | "square" | "diamond"
"circle"
Dot shape.
pattern
Type "grid" | "stagger"
"grid"
"stagger" shifts every other row by half a step.
spacing
Type number
20
Distance between dots.
size
Type number
2.5
Dot diameter.
intensity
Type number
0.7
Strength of the drifting colour wave; 0 leaves only the pointer light.
twinkle
Type number
0.5
How often single dots sparkle.
glow
Type number
0.6
Soft halo around lit dots.
ambient
Type number
0.5
Pale wash of colour drifting under the grid.
fade
Type number
1
Fade toward the edges, so the grid has no hard border.
speed
Type number
1
Animation speed; 1 is the designed pace.
grain
Type number
0
Film grain strength.
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
160
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).
trail
Type number
0.6
How much the light stretches into a tail while the pointer moves.
magnify
Type number
0.5
Loupe strength: how much the dots under the light are enlarged.
ripples
Type boolean
true
A click sends a ring of light across the grid.
children
Type ReactNode
–
Content shown on top of the background.
className
Type string
–
Classes for the box; it fills whatever size you give it.