audiocn-svelte
Esc

Start typing to search the docs

Channel Toggle

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

1 min read · 182 words

Installation

$ pnpm dlx shadcn-svelte@latest add https://juddisjudd.github.io/audiocn-svelte/r/channel-toggle.json

Usage

<script lang="ts">
	import { MuteToggle, SoloToggle } from "#lib/components/ui/channel-toggle/index.js";

	let muted = $state(false);
	let solo = $state(false);
</script>

<MuteToggle bind:pressed={muted}>M</MuteToggle>
<SoloToggle bind:pressed={solo}>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
aria-pressed, data-state="on"Pressed
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

PropTypeDefault
pressed

Bindable.

booleanfalse
onPressedChange (pressed: boolean) => void—
tone

Colour when pressed.

"mute" | "solo" | "monitor" | "neutral"per export
variant "default" | "outline" | "ghost""default"
size "sm" | "default" | "lg" | "icon""default"
disabled

Inherited from a channel strip.

booleanfalse
Last updated on October 7, 2026