Flickering Grid

A flickering grid background made with Canvas, fully customizable using Tailwind CSS.

Install using CLI

npm
pnpm
bun
yarn
npx shadcn-vue@latest add "https://inspira-ui.com/r/flickering-grid.json"

Install Manually

Copy and paste the following code

FlickeringGrid.vue

API

Prop NameTypeDefaultDescription
squareSizenumber4Size of each square in the grid.
gridGapnumber6Gap between squares in the grid.
flickerChancenumber0.3Probability of a square flickering.
colorstringrgb(0, 0, 0)Color of the squares.
widthnumber-Width of the canvas.
heightnumber-Height of the canvas.
classstring-Additional CSS classes for the canvas.
maxOpacitynumber0.2Maximum opacity of the squares.

Credits