Bar visualizer
A React component in Beamline's Voice & audio category.
A row of bars that says what a voice agent is doing: a sweep while connecting, the person's voice while listening, a slow breath while thinking, the agent's voice while talking. Bars move only while there is something to show.
Use it for
- The state indicator of a voice agent: a call screen, a voice button, a conversation bar.
- Showing that the agent hears you, without a full waveform.
Not for
- A recording's shape (waveform).
- Recording feedback with history (live-waveform).
- The agent's presence or avatar (orb).
Anatomy
- bars (5–40, centred in the full width of the room)
- state caption (optional, visible; a new word fades in in place)
- reduced-motion level number
Variants
- align: center, bottom
- size: sm, md, lg
States
- idle (still)
- connecting (a highlight sweeps across)
- listening (follows the source)
- thinking (bars breathe together)
- talking (follows the source, accent)
- off screen (stopped)
- reduced motion (still bars by state, a dB number while sound plays)
- short room (the outer bars fold away in pairs; the middle stays and no bar is squeezed)
Keyboard
- None: a picture of the agent's state (role img named by the state).
Motion
Bars are transforms written straight to the DOM each frame while listening or talking, on screen; connecting and thinking are compositor CSS loops tied to the state; idle runs nothing. Leaving a voice, the bars settle back to rest over --pui-motion-out instead of dropping, and colour changes over --pui-motion-out. The caption's new word fades in where the last one was (--pui-fade-in). Under reduced motion nothing loops: connecting holds every other bar raised, thinking an even row in the accent, both with the state in words; listening and talking show a dB number.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
state | null | "connecting" | "listening" | "thinking" | "talking" | null | What the agent is doing; the same words as Orb's agentState. |
source | MediaStream | LevelSource | (() => number) | null | — | Whose voice to draw: the person's while listening, the agent's while talking. |
bars | number | 15 | Number of bars. Default 15. In less room the outer bars fold away in pairs (the middle, where a voice is loudest, stays); a bar is never squeezed thinner. |
align | "center" | "bottom" | "center" | Alignment within the available space. Defaults to "center". |
size | "sm" | "md" | "lg" | "md" | Control size within the supported size steps. Defaults to "md". |
showLabel | boolean | — | A visible caption with the state in words. |
label | string | "Agent" | Who the bars are about. Default "Agent". |
classNames | BarVisualizerClassNames | — | Classes for the named visual parts; no part overrides by default. |
style / ref | CSSProperties / native Ref | — | style: Inline styles on the documented visual root; no inline overrides by default. ref: Receives the documented root element; no ref by default. |
className | string | — | Classes on the documented visual root; no override by default. |
style | CSSProperties | — | Inline styles on the documented visual root; no inline overrides by default. |
ref | Ref<HTMLDivElement> | — | Receives the documented root element; no ref by default. |
Used in
Import
import { BarVisualizer } from "@beamline/bar-visualizer";
Get it
Bar visualizer is part of Beamline UI. Install the parts you need in your React app as compiled packages or editable source. Get Beamline · Connect your agent
More in Voice & audio
- Recorded answer: A spoken answer against a time limit: record (the microphone asked for first, a blocked one said with what to do), the running time against the limit…
- Orb: The agent's presence: a thin ring of light around a lens in the brand's hue that holds still at rest, sends an arc round while thinking and widens with…
- Call grid: The people on a video call, laid out for the room they are given: tiles as large as the space allows at the camera's shape, or the person talking (or a…
- Matrix: A dot-matrix display: animated frame sets (loading, pulse, wave, syncing), text and digits in a 5×7 font, or a VU meter of levels or a live source. One…
- Transcript viewer: A recording and its words together: the spoken word lights up as it plays and the transcript follows it, any word or paragraph time plays from there…
- Waveform: The shape of a recording: one bar per slice of loudness, fitted to any width, with the played part in the accent, unmeasured slices hatched and a loading…
- Live waveform: Loudness drawn as it happens: a scrolling history of the microphone (or any live source) or its spectrum, a calm processing state while words are…
- Conversation bar: The control bar of a voice call with an agent: one button to call and hang up, the agent's state as bars, a call timer, mute, and typing when talking is…
- Audio player: One audio element and its controls: play with a loading state, a scrub bar with time, skip, speed and a playlist whose rows play into the same player…
- Voice button: The control that starts and stops talking: click to toggle or hold to talk (pointer, Space, Enter or a global shortcut), with a live level while…
- Scrub bar: A seekable timeline for audio or video: elapsed and total time, what has loaded, chapter marks, a time preview under the pointer, and the full keyboard…
- Speech input: A text field you can speak into: the mic dictates through any speech-to-text provider, the phrase being heard shows apart from the finished words, and…
- Voice picker: Choose a text-to-speech voice from a searchable list (name, accent, tone, use) and hear it first: each voice has its own orb, previews play one at a time…
- Microphone selector: Choose the microphone, test it with a live level and mute it, with every permission and device state spelled out: not yet allowed, blocked (and how to…