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/bar-visualizer

bar-visualizer

elevenlabs/bar-visualizer
FreeComponent

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/bar-visualizer.json

Source

components/ui/bar-visualizer.tsxraw.githubusercontent.com/elevenlabs/ui/main/apps/www/public/r/bar-visualizer.json · first 6 KB
1"use client"
2
3import {
4 forwardRef,
5 memo,
6 useEffect,
7 useMemo,
8 useRef,
9 useState,
10 type HTMLAttributes,
11} from "react"
12
13import { cn } from "@/lib/utils"
14
15export interface AudioAnalyserOptions {
16 fftSize?: number
17 smoothingTimeConstant?: number
18 minDecibels?: number
19 maxDecibels?: number
20}
21
22function createAudioAnalyser(
23 mediaStream: MediaStream,
24 options: AudioAnalyserOptions = {}
25) {
26 const audioContext = new (window.AudioContext ||
27 (window as unknown as { webkitAudioContext: typeof AudioContext })
28 .webkitAudioContext)()
29 const source = audioContext.createMediaStreamSource(mediaStream)
30 const analyser = audioContext.createAnalyser()
31
32 if (options.fftSize) analyser.fftSize = options.fftSize
33 if (options.smoothingTimeConstant !== undefined) {
34 analyser.smoothingTimeConstant = options.smoothingTimeConstant
35 }
36 if (options.minDecibels !== undefined)
37 analyser.minDecibels = options.minDecibels
38 if (options.maxDecibels !== undefined)
39 analyser.maxDecibels = options.maxDecibels
40
41 source.connect(analyser)
42
43 const cleanup = () => {
44 source.disconnect()
45 audioContext.close()
46 }
47
48 return { analyser, audioContext, cleanup }
49}
50
51/**
52 * Hook for tracking the volume of an audio stream using the Web Audio API.
53 * @param mediaStream - The MediaStream to analyze
54 * @param options - Audio analyser options
55 * @returns The current volume level (0-1)
56 */
57export function useAudioVolume(
58 mediaStream?: MediaStream | null,
59 options: AudioAnalyserOptions = { fftSize: 32, smoothingTimeConstant: 0 }
60) {
61 const [volume, setVolume] = useState(0)
62 const volumeRef = useRef(0)
63 const frameId = useRef<number | undefined>(undefined)
64
65 // Memoize options to prevent unnecessary re-renders
66 const memoizedOptions = useMemo(
67 () => options,
68 [
69 options.fftSize,
70 options.smoothingTimeConstant,
71 options.minDecibels,
72 options.maxDecibels,
73 ]
74 )
75
76 useEffect(() => {
77 if (!mediaStream) {
78 setVolume(0)
79 volumeRef.current = 0
80 return
81 }
82
83 const { analyser, cleanup } = createAudioAnalyser(
84 mediaStream,
85 memoizedOptions
86 )
87
88 const bufferLength = analyser.frequencyBinCount
89 const dataArray = new Uint8Array(bufferLength)
90 let lastUpdate = 0
91 const updateInterval = 1000 / 30 // 30 FPS
92
93 const updateVolume = (timestamp: number) => {
94 if (timestamp - lastUpdate >= updateInterval) {
95 analyser.getByteFrequencyData(dataArray)
96 let sum = 0
97// … truncated

Files it writes

  • registry/elevenlabs-ui/ui/bar-visualizer.tsx

Facts

Registry
shadcn/ui
Type
registry:ui
Access
Free
Files written
1
Licence
MIT
In the index
at or before 2026-08-12
Last confirmed
3 days ago

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-playeraudio-playershadcn/uiComponentsFree2 deps
conversationconversationshadcn/uiComponentsFree1 dep
conversation-barconversation-barshadcn/uiComponentsFree1 dep
live-waveformlive-waveformshadcn/uiComponentsFreeno deps
matrixmatrixshadcn/uiComponentsFreeno deps
messagemessageshadcn/uiComponentsFree1 dep
mic-selectormic-selectorshadcn/uiComponentsFreeno deps
orborbshadcn/uiComponentsFree4 deps

Also from Kynth Studios

Built for the same person as BlockDex

SkillWorks

Claude Code skills and plugins, scored

skillworks.kynth.studio

RuleStack

AGENTS.md gallery and agent-config comparison

rulestack.kynth.studio

ToolDrift

What the AI coding tools changed last night

tooldrift.kynth.studio

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and ToolDrift

part of Toolproof, the measurement layer for AI agent tooling

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

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and ToolDrift

part of Toolproof, the measurement layer for AI agent tooling

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

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and ToolDrift

part of Toolproof, the measurement layer for AI agent tooling

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

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex