Skip to content
Sign in
AudioLevel meterMenu

Level meterPro

A segmented level meter, vertical or horizontal, mono or stereo, with peak hold and a clip light, read every frame without re-rendering.

ProStereo, vertical and horizontal, with peak hold and a clip light that latches until pressed.

Installation

$ pnpm dlx shadcn@latest add @chatcn-pro/level-meter

Usage

tsx
import { LevelMeter } from "@/components/ui/chatcn/pro/level-meter"

<LevelMeter level={() => analyserPeak()} scale />

Pass amplitude from 0 to 1, an array for several channels, or a getter. Segments are green while safe, amber from -12 dB and red from -3 dB; the clip light latches at full scale until pressed. It stops reading while the tab is hidden.

Examples

States

ProSilent, safe, near the limit, clipping and horizontal.

Props

PropTypeNotes
levelLevelReading | () => LevelReadingRequired. Amplitude, not dB
orientation"vertical" | "horizontal"Default vertical
segments, floornumberDefault 24 or 32, and -60 dB
peakHold, clipLight, scalebooleanDefault true, true, false
size"sm" | "md"Default md
labelsPartial<LevelMeterLabels>Every string the meter shows or announces, for translation

Keyboard

KeyAction
Enter on the clip lightClear it

Accessibility

  • A meter from -60 to 0 dB; its spoken value updates twice a second, never per frame.
  • Zones have position as well as color, and forced colors draw lit segments in the system ink.

Motion

  • Segments rise at once and fall at 24 dB a second; the peak marker holds 1.2 s. Reduced motion follows the level directly.