Controls

Voice Glow

Type
Color variant
Theme
Processing
Active
Paused
Input
Shape
Preview
Reduced motion

Simulates prefers-reduced-motion for the demo. Off follows your system setting.

Keyboard stepping

Steps focus through the demo with ] and [. Tab, arrows, and Escape stay native so the component behaves as shipped.

Voice Glow
Ask anything
Showing a simulated voice; press Listen to use your mic

Voice Glow

A colorful glow that rises from the bottom edge of any element and blooms with a voice.

Installation

npx shadcn@latest add @pixel-ui-pro/voice-glow

How to use

import { useRef } from "react";
import { VoiceGlow, useMicrophone } from "@/components/ui/voice-glow";
export default function Demo({ thinking }: { thinking: boolean }) {
const mic = useMicrophone();
return (
<>
<VoiceGlow stream={mic.stream} processing={thinking} className="w-[350px]">
<input className="h-14 w-full rounded-2xl border px-4" placeholder="Ask anything" />
</VoiceGlow>
<button onClick={mic.state === "live" ? mic.stop : mic.start}>
{mic.state === "live" ? "Stop" : "Listen"}
</button>
</>

Source Code

The source comes with Pro. Install it with your license key and the file is yours to edit.

Get Pro

Props

Options you can pass to customize this component.

Prop
Type
Description
type
defaultpillmobile

Geometry preset: a chat input, a small recording pill, or the bottom of a phone screen. Sets the default reach and blur.

stream
MediaStreamnull

Audio to react to, usually from useMicrophone. Wins over level.

level
number | (() => number)

Input from 0 to 1 when there is no stream. Pass a function to have it read every frame.

processing
boolean

Gathers the glow into one beam that sweeps side to side.

colorVariant
colorfulmonooceansunsetforestcandyicegold

Named palette for the lobes.

colors
string[]

Your own lobe colors, up to 7. Overrides colorVariant.

bandColors
{ core?: string; above?: string; mid?: string; below?: string }

Extra bands: core is a bright line on the edge, mid a band just above it, above a haze higher up, and below a spill under the element. Each shows only when set.

sensitivity
number

Gain applied to the input before the threshold.

threshold
number

Input below this, from 0 to 1, is treated as silence.

attack
number

Seconds the glow takes to rise toward a louder input.

release
number

Seconds the glow takes to fall back after the input drops.

reach
number

How high the glow can climb, as a share of the element's height. Defaults to 0.9, 1 or 0.4 for default, pill and mobile.

spread
number

How far apart the lobes sit across the width, from 0 to 1.

flow
number

How fast and far the lobes drift and wobble, from 0 to 1.

bend
number

How much shorter the lobes are toward the sides, from 0 to 1.

idle
number

Height the glow rests at during silence, from 0 to 1.

theme
autodarklightdither

dark lightens what it covers, light paints over it, auto follows the dark class. dither draws the glow in 4 pixel dots that thin out toward its edges.

strength
number

Opacity of the effect, from 0 to 1.

active
boolean

Turn off to fade the glow out.

paused
boolean

Freezes the glow where it is.

scale
number

Multiplies the size and blur of the lobes.

className
string

Classes applied to the root, which wraps your element.