BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/sv11-twango/bar-visualizer

Bar Visualizer

sv11-twango/bar-visualizer
FreeComponent

A discrete bar-style audio level visualizer driven by a frequency array.

Live preview

live · rendered by the registry
Rendered by sv11-twango on their own page — this is the component running, not a screenshot of it.

Install it

npx shadcn@latest add http://sv11.ui.twango.dev/r/bar-visualizer.json

Source

registry itemsv11.ui.twango.dev/r/bar-visualizer.json · first 6 KB
1<script lang="ts" module>
2 import type { HTMLAttributes } from "svelte/elements";
3
4 export type AgentState = "connecting" | "initializing" | "listening" | "speaking" | "thinking";
5
6 export type BarVisualizerProps = HTMLAttributes<HTMLDivElement> & {
7 /**
8 * Voice-agent lifecycle state. Drives the bar highlight sequence and
9 * animation cadence. Leave undefined for a static row.
10 */
11 state?: AgentState;
12 /**
13 * Number of bars to render across the visualizer.
14 * @default 15
15 */
16 barCount?: number;
17 /**
18 * Live audio source used for FFT analysis. Ignored when `demo` is
19 * `true`. Pass `null` to disable analysis without unmounting.
20 */
21 mediaStream?: MediaStream | null;
22 /**
23 * Minimum bar height as a percentage of the container.
24 * @default 20
25 */
26 minHeight?: number;
27 /**
28 * Maximum bar height as a percentage of the container.
29 * @default 100
30 */
31 maxHeight?: number;
32 /**
33 * When `true`, replaces the FFT feed with a synthetic oscillating
34 * pattern. Useful for previews and documentation.
35 * @default false
36 */
37 demo?: boolean;
38 /**
39 * Align bars from the vertical center rather than growing up from the
40 * bottom.
41 * @default false
42 */
43 centerAlign?: boolean;
44 /** Bound reference to the root container element. */
45 ref?: HTMLDivElement | null;
46 };
47</script>
48
49<script lang="ts">
50 import { cn } from "$UTILS$.js";
51 import {
52 createAudioAnalyser,
53 generateConnectingSequenceBar,
54 generateListeningSequenceBar,
55 normalizeDb,
56 } from "./utils.js";
57
58 let {
59 state: agentState,
60 barCount = 15,
61 mediaStream,
62 minHeight = 20,
63 maxHeight = 100,
64 demo = false,
65 centerAlign = false,
66 class: className,
67 style,
68 ref = $bindable(null),
69 ...restProps
70 }: BarVisualizerProps = $props();
71
72 let realBands = $state<number[]>(new Array(barCount).fill(0));
73 let fakeBands = $state<number[]>(new Array(barCount).fill(0.2));
74 let highlightedIndices = $state<number[]>([]);
75
76 const volumeBands = $derived(demo ? fakeBands : realBands);
77
78 const animInterval = $derived(
79 agentState === "connecting"
80 ? 2000 / barCount
81 : agentState === "thinking"
82 ? 150
83 : agentState === "listening"
84 ? 500
85 : 1000
86 );
87
88 // useMultibandVolume — real FFT analysis
89 $effect(() => {
90 if (demo || !mediaStream) {
91 realBands = new Array(barCount).fill(0);
92 return;
93 }
94 const currentBarCount = barCount;
95 const { analyser, cleanup } = createAudioAnalyser(mediaStream, { fftSize: 2048 });
96
97// … truncated

Facts

Registry
sv11-twango
Type
registry:ui
Access
Free
Files written
0
Licence
MIT
First indexed
2026-08-02
Last confirmed
2 days ago

Go to the source

Docs on sv11-twango sv11.ui.twango.dev twangodev/sv11-ui on GitHub Raw registry item This item as JSON

More from sv11-twango

All 29 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
Audio Playeraudio-playersv11-twangoComponentsFree2 deps
Conversationconversationsv11-twangoComponentsFree2 deps
Conversation Barconversation-barsv11-twangoComponentsFree1 dep
Live Waveformlive-waveformsv11-twangoComponentsFreeno deps
Matrixmatrixsv11-twangoComponentsFreeno deps
Messagemessagesv11-twangoComponentsFree2 deps
Mic Selectormic-selectorsv11-twangoComponentsFree1 dep
Orborbsv11-twangoComponentsFree4 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