live-waveform-demo
elevenlabs/live-waveform-demoFreeExample
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/live-waveform-demo.jsonSource
1"use client"23import { useState } from "react"45import { Button } from "@/components/ui/button"6import { LiveWaveform } from "@/components/ui/live-waveform"78export default function LiveWaveformDemo() {9 const [active, setActive] = useState(false)10 const [processing, setProcessing] = useState(false)11 const [mode, setMode] = useState<"static" | "scrolling">("static")1213 const handleToggleActive = () => {14 setActive(!active)15 if (!active) {16 setProcessing(false)17 }18 }1920 const handleToggleProcessing = () => {21 setProcessing(!processing)22 if (!processing) {23 setActive(false)24 }25 }2627 return (28 <div className="bg-card w-full rounded-lg border p-6">29 <div className="mb-4">30 <h3 className="text-lg font-semibold">Live Audio Waveform</h3>31 <p className="text-muted-foreground text-sm">32 Real-time microphone input visualization with audio reactivity33 </p>34 </div>3536 <div className="space-y-4">37 <LiveWaveform38 active={active}39 processing={processing}40 height={80}41 barWidth={3}42 barGap={2}43 mode={mode}44 fadeEdges={true}45 barColor="gray"46 historySize={120}47 />4849 <div className="flex flex-wrap justify-center gap-2">50 <Button51 size="sm"52 variant={active ? "default" : "outline"}53 onClick={handleToggleActive}54 >55 {active ? "Stop" : "Start"} Listening56 </Button>57 <Button58 size="sm"59 variant={processing ? "default" : "outline"}60 onClick={handleToggleProcessing}61 >62 {processing ? "Stop" : "Start"} Processing63 </Button>64 <Button65 size="sm"66 variant="outline"67 onClick={() => setMode(mode === "static" ? "scrolling" : "static")}68 >69 Mode: {mode === "static" ? "Static" : "Scrolling"}70 </Button>71 </div>72 </div>73 </div>74 )75}
What it pulls in
Other registry items
Files it writes
More from shadcn/ui
All 50 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| audio-player-demoaudio-player-demo | shadcn/ui | Examples | Free | no deps | |
| bar-visualizer-demobar-visualizer-demo | shadcn/ui | Examples | Free | no deps | |
| conversation-bar-democonversation-bar-demo | shadcn/ui | Examples | Free | no deps | |
| conversation-democonversation-demo | shadcn/ui | Examples | Free | no deps | |
| matrix-demomatrix-demo | shadcn/ui | Examples | Free | no deps | |
| message-demomessage-demo | shadcn/ui | Examples | Free | no deps | |
| mic-selector-demomic-selector-demo | shadcn/ui | Examples | Free | no deps | |
| orb-demoorb-demo | shadcn/ui | Examples | Free | no deps |
