Square Pattern
An interactive grid background where squares randomly light up with colorful accents and react to hover.
Installation
Pro components require registry authentication. Add your Unlumen UI Pro key as UNLUMEN_LICENSE_KEY in your .env.local file and follow the setup guide.
File Structure
Usage
import SquarePattern from "@/components/unlumen-ui/square-pattern";
export default function Example() {
return (
<div className="relative w-full h-64">
<SquarePattern className="absolute inset-0" gridSize={10} />
</div>
);
}API Reference
className?string—Additional classes applied to the root grid element.
gridSize?number10Number of columns (and rows) in the square grid.
minDelay?number0Minimum delay before a square activates in each cycle (ms).
maxDelay?number5500Maximum delay before a square activates in each cycle (ms).
minDuration?number500Minimum duration a square stays lit (ms).
maxDuration?number1500Maximum duration a square stays lit (ms).
fadeDuration?number1000Transition duration for the color fade-out when a square deactivates (ms).
Credits
Built by leo.
Keep in mind
Most components on this site are inspired by or recreated from existing work across the web. I'm not here to take credit; just to learn, experiment, and sometimes push things a bit further. If something looks familiar and I forgot to mention you, reach out and I'll fix that right away.
This component is part of Unlumen UI [ Pro ]
Includes advanced motion, patterns, and premium support.