audiocn

Channel Toggle

Mute, solo and monitor toggle buttons with their own pressed colours.

Installation

$ pnpm dlx shadcn@latest add @audiocn/channel-toggle

Usage

import {
  MonitorToggle,
  MuteToggle,
  SoloToggle,
} from "@/components/ui/channel-toggle";
<MuteToggle pressed={muted} onPressedChange={setMuted}>M</MuteToggle>
<SoloToggle pressed={solo} onPressedChange={setSolo}>S</SoloToggle>

The presets set the tone and a default aria-label. Children are a letter, a word or an icon; nothing is rendered by default. Use ChannelToggle with a tone for anything else.

Examples

Variants

default
outline
ghost

Theming

Token or attributeMeaning
--channel-mute, --channel-solo, --channel-monitorPressed colours
data-pressedPressed
data-tonemute, solo, monitor or neutral

Accessibility

Toggles are buttons with aria-pressed. The presets are labelled "Mute", "Solo" and "Monitor"; override aria-label to name the channel, such as "Mute microphone".

API reference

Prop

Type