Bar Visualizer

A dynamic audio visualization component for voice agents and media.

Installation

npx shadcn-vue@latest add https://raya-ui.com/registry/bar-visualizer.json

Usage

<script setup lang="ts">
import { BarVisualizer } from '@/components/ui/bar-visualizer'
</script>

<template>
  <BarVisualizer
    state="speaking"
    :bar-count="20"
    demo
    class="h-32 w-full bg-zinc-900 rounded-lg p-4"
  />
</template>

Props

PropTypeDefaultDescription
stateAgentState-Current state ('speaking', 'listening', 'thinking', 'connecting', 'initializing').
barCountnumber15Number of bars to display.
demobooleanfalseIf true, simulates audio visualization without a stream.
mediaStreamMediaStreamnullThe audio stream to visualize (if not in demo mode).
minHeightnumber20Minimum height percentage of the bars.
maxHeightnumber100Maximum height percentage of the bars.