Wave volume (Pro)
ProIncluded in $99A volume slider whose track is the sound.
On this page
ProDrag down and the speaker loses its waves; fling to the top and the thumb squashes while the peaks hit the ceiling and flash.
Left of the thumb the bars dance to what is playing; right of it they rest at their shape. The thumb squashes and stretches with how fast you drag it, the speaker loses its waves as you go quiet, and the number rolls. Fling it to the top and the peaks that hit the ceiling flash hot under a clip line, then calm down. Give it an analyser and the bars follow the real audio, like the voice an agent is speaking.
Installation
Needs chatcn Pro
This command works with a Pro license, along with every Pro component.
Or start free: sign up and get three Pro components on us, with a new one every month.
Usage
import { WaveVolume } from "@/components/ui/chatcn/pro/wave-volume"
<WaveVolume value={volume} onValueChange={setVolume} analyser={voiceAnalyser} />Props
| Prop | Type | Notes |
|---|---|---|
value / defaultValue / onValueChange | number | 0 to 1 |
playing | boolean | Default true |
analyser | AnalyserNode | Real audio for the bars |
label | ReactNode | Default Volume |
Keyboard
| Key | Action |
|---|---|
Arrow keys | 2 percent, 10 with Shift |
Home / End | Silent or full |
Accessibility
- A slider with its value as a percentage.
Motion
- The thumb squash rides a spring from drag speed; the clip flash decays over about a second. Reduced motion: the thumb jumps and the bars hold still.