The Matrix component is a retro dot-matrix display that supports static patterns, animations, and VU meter modes.
Importing components:
import { digits, loader, Matrix, vu, wave } from "@/components/ui/matrix"
Static Pattern (e.g., using digits):
<Matrix rows={7} cols={5} pattern={digits[5]} ariaLabel="Number five" />
Animated Display (e.g., using wave):
<Matrix
rows={7}
cols={7}
frames={wave}
fps={20}
loop
ariaLabel="Wave animation"
/>
VU Meter (Audio Visualization):
<Matrix
rows={7}
cols={12}
mode="vu"
levels={[0.1, 0.6, 0.9, 0.7, 0.4, 0.8, 0.5, 0.3, 0.6, 0.9, 0.5, 0.2]}
/>
import { digits, loader, Matrix, vu, wave } from "@/components/ui/matrix"
// Static Pattern
<Matrix rows={7} cols={5} pattern={digits[5]} ariaLabel="Number five" />
// Animated Display
<Matrix
rows={7}
cols={7}
frames={wave}
fps={20}
loop
ariaLabel="Wave animation"
/>
// VU Meter
<Matrix
rows={7}
cols={12}
mode="vu"
levels={[0.1, 0.6, 0.9, 0.7, 0.4, 0.8, 0.5, 0.3, 0.6, 0.9, 0.5, 0.2]}
/>