Components · 2 min read
DotMatrix
Core dot matrix animation component for creating pixel-based animations
DotMatrix
The DotMatrix component is the core building block for creating dot matrix animations.
Basic Usage
Props
| Prop | Type | Default | Description |
|---|---|---|---|
sequence* | number[][] | - | Array of frames, each frame is an array of dot indices to activate |
cols | number | 7 | Number of columns in the grid |
rows | number | 7 | Number of rows in the grid |
dotSize | number | 8 | Size of each dot in pixels |
gap | number | 4 | Gap between dots in pixels |
interval | number | 100 | Animation interval in milliseconds |
shape | 'rounded' | 'square' | 'circle' | 'rounded' | Shape of the dots |
color | string | '#10b981' | Color of active dots |
inactiveColor | string | 'rgba(16, 185, 129, 0.1)' | Color of inactive dots |
activeDotStyle | CSSProperties | - | Additional styles for active dots |
Grid Index System
Understanding the grid index system is essential for creating animations: