Build a React voice agent UI
Install the component package:What a voice agent UI has to communicate
The important job of a voice agent UI is trust. A user should understand whether the app heard them, whether the assistant is waiting, and whether the assistant is speaking. The visual state should change quickly enough to feel alive, but it should not distract from the conversation. orb-ui models the core lifecycle as:idleconnectinglisteningthinkingspeakingerror
State is the semantic layer. Volume is the motion layer. Keep them separate so a noisy microphone
cannot make an idle assistant look active and a silent model response cannot leave the UI stuck in
the wrong state.
Design the lifecycle before the animation
Write the state transitions down before choosing colors or motion. A normal browser conversation usually follows this path:- The user explicitly starts the session.
- The UI enters
connectingwhile credentials, media, and the provider connection initialize. - The UI enters
listeningonly after the session can receive input. - The end of a user turn moves through
thinkingwhen the provider exposes that boundary. - Remote audio moves the UI to
speaking. - A completed or interrupted response returns to
listening. - Stop and cleanup return to
idle; failures move toerrorwith a recovery action.
React voice agent UI architecture
Use an adapter when a provider can supply a normalized voice signal for you. Use controlled mode when your app already owns the voice session lifecycle. For the completeOrbSignal and OrbAdapter contract, separate input/output metering, and a custom
adapter example, read the signal-based voice agent UI guide.
Controlled mode is especially useful for teams experimenting with OpenAI Realtime, Gemini Live API, telephony backends, or internal speech pipelines.
Use OrbSignal when the browser can measure the user and agent independently:
inputVolume should follow the local microphone while listening. outputVolume should follow the
remote agent while speaking. Themes can then communicate who owns the turn instead of reacting to
one ambiguous volume value.
Microphone permission and connection feedback
Microphone permission is part of the product experience. Ask for it after a clear user action, not on page load. While the browser prompt is open, keep the interface in a neutral connecting state and explain why audio access is needed near the control that requested it. Handle common failures explicitly:- permission denied or dismissed
- no usable input device
- provider credential or token failure
- WebRTC or WebSocket connection timeout
- remote audio blocked by browser playback policy
- a session that closes unexpectedly
error with a short message such as
“Microphone access is blocked” or “The voice session disconnected,” plus the smallest useful next
action. Preserve diagnostic detail for logs rather than showing transport errors directly to users.
Interruption, transcript, and handoff
The orb is a compact status surface, not the whole voice application. Products that need precise conversation context should place it beside:- a transcript or live captions
- mute and stop controls
- elapsed time or connection status
- retry and reconnect actions
- human handoff status
- provider-specific consent or recording notices
Accessibility and reduced motion
A voice visualization should never be the only way to understand the session. Keep an accessible name on interactive themes, expose visible status text when state matters, and preserve keyboard activation for start and stop controls. Avoid using color alone to distinguish listening, speaking, and error states. Motion should support comprehension:- keep idle motion slow and low contrast
- use input and output levels to change intensity, not to trigger unrelated layout movement
- avoid flashes or rapid oscillation
- respect reduced-motion preferences in the surrounding application
- keep focus indicators visible when the orb is interactive
debug theme during integration to confirm that state and volume change correctly before
evaluating a polished theme.
Choose a provider integration path
The adapter comparison explains which layer owns authentication, media,
playback, state mapping, and cleanup for each provider.
UI patterns that help adoption
For developer tools, the fastest path to adoption is:- a visible demo
- a short install command
- a provider-specific code sample
- a custom controlled-mode example
- honest language about what the UI layer does and does not do
React voice agent UI production checklist
Before shipping a React voice agent UI, verify that:- the start action creates a fresh provider session or credential when required
- connecting, listening, thinking, speaking, idle, and error transitions are observable
- microphone and agent audio drive the correct volume direction
- remote audio stops on interruption and session cleanup
- the user can stop the conversation without clicking the animated artwork
- permission, token, network, and device failures have recovery copy
- keyboard users can operate every interactive control
- reduced motion and visible focus styles remain usable
- the page links to a provider-specific setup or a complete custom integration contract
Future signals
The state model is intentionally small. As provider adapters mature, likely signal additions include:interruptedmutedtranscribinghandoff