Skip to documentation content

Voice Orb

Show whose turn it is in a voice conversation, with a round mark that listens, thinks, and speaks.

voice-orb-demo

Overview

In a voice conversation there is no text to read while the turn changes hands. Voice Orb gives the person something to watch: it breathes at rest, swells with their voice while it listens, turns while the assistant thinks, and ripples with the reply while it speaks.

It shows state; it does not decide it. state comes from your voice pipeline, and inputLevel and outputLevel are loudness figures you measure. The orb opens no microphone and plays no audio.

Anatomy

VoiceOrb
  • CanvasThe body, its halo, and the thinking arc, drawn each frame
  • GlyphA still disc with a mark for each state, shown in place of the canvas with reduced motion
  • StatusThe state as text, for assistive technology

VoiceOrb is one component. It installs motion, which it uses to read the reduced motion setting.

Behavior

States

StateWhat it showsLevel it follows
idleA slow breathNone
listeningA swell and a rippling edgeinputLevel
thinkingAn arc travelling around the outsideNone
speakingA livelier rippleoutputLevel

The state is reported as data-state on the root. A change of state or a jump in level eases in, so the orb never snaps.

Levels

A level is a number from 0 to 1. Pass a number when it comes from React state, or a function the orb calls once per frame, which avoids re-rendering on every audio frame:

<VoiceOrb state="listening" inputLevel={() => meter.current} />

Values outside 0 to 1 are clamped.

Color

The orb is drawn in the text color, so it is dark on light surfaces and light on dark ones. Pass accent with any CSS color to tint it; the color is read at draw time, so tokens such as var(--hui-color-foreground-accent-primary) follow the theme.

Accessibility

The canvas and glyph are hidden from assistive technology. A visually hidden status reads the state, such as "Listening", and is announced when it changes. If text nearby already says the state, set announce to false so it is not read twice.

The orb is not interactive. Put your microphone and stop controls next to it as real buttons.

With reduced motion, the orb does not animate: it shows a still glyph for the state, a dot, a microphone, three dots, or bars.

Every string comes from labels.

Installation

npx honestui@latest add voice-orb

Usage

import { VoiceOrb } from "@/components/ai/voice-orb"

<VoiceOrb
  state={session.state}
  inputLevel={() => micLevel.current}
  outputLevel={() => replyLevel.current}
/>

Examples

Accent color

A smaller orb, tinted with the accent color, in a call header whose text already says the state.

voice-orb-accent

With the Audio Orb shader

For a voice agent's main screen, the Audio Orb shader from Honest UI takes the same state, inputLevel, and outputLevel, and draws a colored glass orb with WebGL. Here it plays through a made-up exchange with a Live Waveform under it and the turn written out, so the state is never shown by the orb alone.

voice-orb-shader

API reference

VoiceOrb

Accepts native div props beyond those listed.

PropTypeDefaultDescription
stateVoiceOrbState"idle"What the assistant is doing.
inputLevelVoiceOrbLevel0The person's loudness, followed while listening.
outputLevelVoiceOrbLevel0The assistant's loudness, followed while speaking.
sizenumber96Diameter in CSS pixels.
accentstringText colorA CSS color for the orb.
announcebooleantrueReads the state in a status region.
labelsPartial<VoiceOrbLabels>EnglishThe text read for each state.

Types

ExportShape
VoiceOrbState"idle", "listening", "thinking", or "speaking"
VoiceOrbLevelA number from 0 to 1, or a function that returns one
VoiceOrbLabelsOne string per state