BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/shadcn/ui/matrix-demo

matrix-demo

elevenlabs/matrix-demo
FreeExample

shadcn/ui publishes no description for this item.

Install it

npx shadcn@latest add https://raw.githubusercontent.com/elevenlabs/ui/main/apps/www/public/r/matrix-demo.json

Source

examples/matrix-demo.tsxraw.githubusercontent.com/elevenlabs/ui/main/apps/www/public/r/matrix-demo.json · first 6 KB
1"use client"
2
3import { useEffect, useState } from "react"
4
5import {
6 Matrix,
7 pulse,
8 snake,
9 wave,
10 type Frame,
11} from "@/components/ui/matrix"
12
13const Example = () => {
14 const [mode, setMode] = useState<
15 "individual" | "focus" | "expand" | "unified" | "collapse" | "burst"
16 >("individual")
17 const [unifiedFrame, setUnifiedFrame] = useState(0)
18 const [expandProgress, setExpandProgress] = useState(0)
19 const [collapseProgress, setCollapseProgress] = useState(0)
20
21 useEffect(() => {
22 let timeout: NodeJS.Timeout
23
24 if (mode === "individual") {
25 timeout = setTimeout(() => setMode("focus"), 4000)
26 } else if (mode === "focus") {
27 timeout = setTimeout(() => setMode("expand"), 2000)
28 } else if (mode === "expand") {
29 timeout = setTimeout(() => setMode("unified"), 2500)
30 } else if (mode === "unified") {
31 timeout = setTimeout(() => setMode("collapse"), 4000)
32 } else if (mode === "collapse") {
33 timeout = setTimeout(() => setMode("burst"), 2500)
34 } else if (mode === "burst") {
35 timeout = setTimeout(() => setMode("individual"), 800)
36 }
37
38 return () => clearTimeout(timeout)
39 }, [mode])
40
41 useEffect(() => {
42 if (mode !== "unified") return
43
44 let frame = 0
45 const animate = setInterval(() => {
46 frame += 1
47 setUnifiedFrame(frame)
48 }, 50)
49
50 return () => clearInterval(animate)
51 }, [mode])
52
53 useEffect(() => {
54 if (mode !== "expand") {
55 setExpandProgress(0)
56 return
57 }
58
59 let start = 0
60 const duration = 2500
61 let animationFrame: number
62
63 const animate = (timestamp: number) => {
64 if (start === 0) start = timestamp
65 const elapsed = timestamp - start
66 const progress = Math.min(elapsed / duration, 1)
67
68 setExpandProgress(progress)
69
70 if (progress < 1) {
71 animationFrame = requestAnimationFrame(animate)
72 }
73 }
74
75 animationFrame = requestAnimationFrame(animate)
76 return () => cancelAnimationFrame(animationFrame)
77 }, [mode])
78
79 useEffect(() => {
80 if (mode !== "collapse") {
81 setCollapseProgress(0)
82 return
83 }
84
85 let start = 0
86 const duration = 2500
87 let animationFrame: number
88
89 const animate = (timestamp: number) => {
90 if (start === 0) start = timestamp
91 const elapsed = timestamp - start
92 const progress = Math.min(elapsed / duration, 1)
93
94 setCollapseProgress(progress)
95
96 if (progress < 1) {
97 animationFrame = requestAnimationFrame(animate)
98 }
99 }
100
101// … truncated

What it pulls in

Other registry items

  • https://ui.elevenlabs.io/r/matrix.json

Files it writes

  • registry/elevenlabs-ui/examples/matrix-demo.tsx

Facts

Registry
shadcn/ui
Type
registry:example
Access
Free
Files written
1
Licence
MIT
First indexed
2026-08-02
Last confirmed
yesterday

Go to the source

ui.elevenlabs.io elevenlabs/ui on GitHub Raw registry item This item as JSON

More from shadcn/ui

All 50 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
audio-player-demoaudio-player-demoshadcn/uiExamplesFreeno deps
bar-visualizer-demobar-visualizer-demoshadcn/uiExamplesFreeno deps
conversation-bar-democonversation-bar-demoshadcn/uiExamplesFreeno deps
conversation-democonversation-demoshadcn/uiExamplesFreeno deps
live-waveform-demolive-waveform-demoshadcn/uiExamplesFreeno deps
message-demomessage-demoshadcn/uiExamplesFreeno deps
mic-selector-demomic-selector-demoshadcn/uiExamplesFreeno deps
orb-demoorb-demoshadcn/uiExamplesFreeno deps
BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex