Mixer
The container for channel strips, with shared meter settings and keyboard navigation.
Audio mixer
Microphone
0.0 dB
System audio
0.0 dB
Music
0.0 dB
Master
Installation
$ pnpm dlx shadcn@latest add @audiocn/mixerUsage
import {
Mixer,
MixerChannels,
MixerHeader,
MixerMaster,
MixerTitle,
} from "@/components/ui/mixer";<Mixer orientation="vertical">
<MixerHeader>
<MixerTitle>Audio mixer</MixerTitle>
</MixerHeader>
<MixerChannels>
{channels.map((channel) => (
<ChannelStrip key={channel.id}>…</ChannelStrip>
))}
</MixerChannels>
<MixerSeparator />
<MixerMaster>
<ChannelStrip variant="master">…</ChannelStrip>
</MixerMaster>
</Mixer>The mixer holds no audio and no state. Pair it with useMixer for state and useWebAudioMixer for sound, or with your own engine.
Anatomy
<Mixer>
<MixerHeader>
<MixerTitle />
<MixerActions />
</MixerHeader>
<MixerChannels />
<MixerEmpty />
<MixerSeparator />
<MixerMaster />
</Mixer>Examples
Console
Sixteen strips in a console. Meters paint outside React, so a full console keeps the frame rate with no re-renders while it meters.
Console
In 1
0.0 dB
In 2
0.0 dB
In 3
0.0 dB
In 4
0.0 dB
In 5
0.0 dB
In 6
0.0 dB
In 7
0.0 dB
In 8
0.0 dB
In 9
0.0 dB
In 10
0.0 dB
In 11
0.0 dB
In 12
0.0 dB
In 13
0.0 dB
In 14
0.0 dB
In 15
0.0 dB
In 16
0.0 dB
Empty
Audio mixer
A complete mixer
The System Audio Mixer block is a working mixer built from these parts.
Behaviour
- Every meter in the mixer shares
minDb,maxDb,zonesandballistics, so levels compare fairly across channels. - With focus on a control in a strip, Ctrl + arrow keys move to the same control on the neighbouring strip: left and right in a console, up and down in rows. Tab still moves through every control in order.
MixerChannelsscrolls along the strip axis when strips overflow; the master area stays in place.MixerEmptyappears whenMixerChannelshas no children.
API reference
Mixer
Prop
Type
MixerChannels
Prop
Type