Mute Toggle

A speaker whose waves fold in under a slash and pump back out.

Preview

"use client";

import { MuteToggle } from "@/components/motion/mute-toggle";

export function MuteToggleUsage() {
  return <MuteToggle />;
}

Install

Add it with the shadcn CLI, or copy the source manually.

$ bunx --bun shadcn add @beui/mute-toggle

API Reference

muted?
boolean

Whether sound is muted, for controlled use.

Default—
defaultMuted?
boolean

Whether it starts muted when uncontrolled. Default: false

Defaultfalse
onMutedChange?
((muted: boolean) => void)

Called with the new muted state when the button is pressed.

Default—
labels?
Partial<{ mute: string; }>

Override any built-in string, e.g. for translation.

Default—
sound?
boolean

Play a falling snap on mute and a rising one on unmute. Off by default; a `SoundProvider` can mute it app-wide.

Defaultfalse
className?
string

Classes merged onto the root element.

Default—

Updated