Installation
Usage
Rounded Squares
Props
| Prop | Type | Default | Description |
|---|---|---|---|
squareSize | number | 4 | Size of each square in the grid (in pixels) |
gridGap | number | 6 | Gap between squares in the grid (in pixels) |
flickerChance | number | 0.3 | Probability of a square flickering (0-1) |
color | string | "rgb(0, 0, 0)" | Color of the squares (any valid CSS color) |
width | number | - | Width of the canvas (auto-sizes to container if not set) |
height | number | - | Height of the canvas (auto-sizes to container if not set) |
className | string | - | Additional CSS classes for the canvas container |
maxOpacity | number | 0.3 | Maximum opacity of the squares (0-1) |
This component uses canvas for optimal performance and automatically pauses animation when not in view using IntersectionObserver.