Flickering Grid

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

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.

Component Code

You can copy and paste the following code to create these components:

FlickeringGrid.vue

Credits