TurboStarter
For the complete documentation index, see llms.txt. Prefer markdown by appending .md to documentation URLs or sending Accept: text/markdown.

<VoiceAvatar />

Seeded, audio-reactive avatar for voices and speakers. A WebGL glass sphere on web and a matching gradient on mobile.

<VoiceAvatar /> gives every voice or speaker a recognizable face. Pass a stable seed, such as a voice ID, and the component derives a unique pattern and color palette from it, so the same voice always looks the same. In the Speech app, it appears in the voice picker, the audio player, and next to each speaker in a transcript.

Web

On web, the avatar is an animated glass sphere rendered with WebGL. It can react to audio volume, so it moves, grows, and brightens while a voice is speaking.

Web voice avatar demo

Mobile

On mobile, the avatar is a static version of the same design drawn with react-native-svg radial gradients. It uses the same palettes and the same seed hashing, so a voice keeps its colors on every platform.

Mobile voice avatar demo

Use-cases

Deterministic identity

The same seed always produces the same avatar, with no images to store or upload.

Audio-reactive

Feed it a live volume level and the sphere responds to the audio in real time.

Cheap to render in lists

All avatars on a page share one WebGL context, offscreen avatars stop rendering, and prefers-reduced-motion is respected.

Styles and palettes

The web avatar ships with five style presets in VOICE_AVATAR_STYLES: glass (the default), silk, smoke, marble, and flat. Each preset is a full VoiceAvatarSettings object, so you can start from one and override a few values.

VOICE_AVATAR_PALETTES contains 14 four-color palettes, such as ember, lilac, mint, citrus, graphite, midnight, and plum. Without colors, the avatar picks one from the seed with getVoiceAvatarPalette(seed). Both platforms export the same palettes.

Usage

import {
  VOICE_AVATAR_PALETTES,
  VOICE_AVATAR_STYLES,
  VoiceAvatar,
} from "@workspace/ui-web/voice/voice-avatar";

export const SpeakingAvatar = ({
  voiceId,
  getVolume,
}: {
  voiceId: string;
  getVolume: () => number;
}) => (
  <VoiceAvatar
    seed={voiceId}
    colors={VOICE_AVATAR_PALETTES.lilac}
    settings={{ ...VOICE_AVATAR_STYLES.silk, reactivity: 0.8 }}
    animation="always"
    getVolume={getVolume}
    className="size-24"
  />
);
PropPurpose
seedStable identifier that sets the pattern and the default palette.
colorsFour colors from darkest to lightest. Overrides the seeded palette.
settingsPartial VoiceAvatarSettings: scale, warp, swirl, refraction, rim, grain, etc.
animationnone, hover (default, animates on pointer or focus), or always.
volumeStatic volume level from 0 to 1.
getVolumeCalled every frame for a live volume level. Takes precedence over volume.
maxResolutionUpper bound for the canvas size in device pixels (default 512).

The settings also include reactivity, which controls how strongly the volume affects motion, scale, and brightness.

How is this guide?

Last updated on

On this page

Make AI your edge, not replacement.Try AI Kit