For Tailwind CSS v3 docs, click here.

Flickering Grid

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

通过 CLI 安装

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

手动安装

复制并粘贴以下代码:

FlickeringGrid.vue

API

Prop 名称类型默认值描述
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.

感谢