# Mute Toggle

> A sound toggle whose waves fold away one at a time before a slash cuts through the speaker, and come back in reverse.

## Spec sheet

| | |
| --- | --- |
| Access | Free: no account, free for commercial use |
| Shelf | Components › State Changes |
| Live preview | https://uibrik.com/components/mute-toggle |
| Writes | 1 file into `components/uibrik/mute-toggle/` |
| Packages | `motion`, `react-use-measure` (the CLI installs them) |
| Needs | React 19, Tailwind CSS v4, a project set up with `npx shadcn@latest init` |
| Theme | Reads the shadcn tokens and follows class-based dark mode ([theming](https://uibrik.com/docs/theming.md)) |
| Updated | Nov 22, 2026 |

## Add it

```bash
npx shadcn@latest add https://uibrik.com/r/mute-toggle.json
```

With the `@uibrik` namespace in `components.json` ([setup](https://uibrik.com/docs/installation.md)): `npx shadcn@latest add @uibrik/mute-toggle`.

Can't run commands? https://uibrik.com/components/mute-toggle/prompt.txt has every file verbatim, with the setup steps, ready for an assistant to write.

## Render it

Renders as is; every value shown is the default, so delete any line you don't need.

```tsx
import { MuteToggle } from "@/components/uibrik/mute-toggle/mute-toggle";

<MuteToggle
  display="icon"
  variant="soft"
  size="md"
  mutedColor="#dc2626"
  defaultMuted={false}
  // muted={false}
  // onMutedChange={(muted) => {}}
/>
```

## Tune it

The same props as the Customize panel on https://uibrik.com/components/mute-toggle.

| Prop | Type | Default | What it does |
| --- | --- | --- | --- |
| `display` | `"icon" \| "label"` | `"icon"` | Icon alone, or with a label that rolls between states. |
| `label` | `string` | `"Sound on"` | Label while sound is on. |
| `mutedLabel` | `string` | `"Muted"` | Label while muted. |
| `variant` | `"soft" \| "ghost"` | `"soft"` | Filled, or transparent until hovered. |
| `size` | `"sm" \| "md" \| "lg"` | `"md"` | Height and icon size. |
| `mutedColor` | `string` | `"#dc2626"` | Tint of the icon while muted. |
| `defaultMuted` | `boolean` | `false` | State on mount when uncontrolled. |

## Wire it

The props the Customize panel doesn't show: ranges, data, content and callbacks.

| Prop | Type | Default | What it does |
| --- | --- | --- | --- |
| `muted / onMutedChange` | `boolean / (muted) => void` |  | Controlled state. |
| `className` | `string` |  | Classes for the button. |

## Where it fits

- **Video and audio players**: The waves folding away show the sound going off, not just an icon swap. Pairs with [Music Player](https://uibrik.com/components/music-player.md) (Pro) and [Voice Note](https://uibrik.com/components/voice-note.md) (Pro).
- **Calls and meetings**: A clear muted state with an optional tint keeps people from talking into a muted mic. Pairs with [Meeting Planner](https://uibrik.com/components/meeting-planner.md) (Pro).
- **Autoplaying hero videos**: A quiet icon-only button sits in a video corner and still reads instantly.

## Same shelf: State Changes

- [Notification Bell](https://uibrik.com/components/notification-bell.md): A notification bell that swings when something new arrives, rolls its badge count up, and drops the badge into the bell once read.
- [Password Peek](https://uibrik.com/components/password-peek.md): A password field whose eye blinks as you toggle it, and whose characters rise into view left to right instead of snapping from dots.
- [Pin Tab](https://uibrik.com/components/pin-tab.md) (Pro): A tab bar where pinning shrinks a tab to its icon and slides it to the front, and unpinning grows it back with its title.
- [Presence Dot](https://uibrik.com/components/presence-dot.md) (Pro): An avatar status dot that morphs between online, away, busy and offline, and opens from the dot itself into a tiny picker that previews each status as you hover.
- [Read Receipts](https://uibrik.com/components/read-receipts.md): A message bubble whose clock turns into one tick, then two, then fills with colour once the message is read.
- [Sync Button](https://uibrik.com/components/sync-button.md): A sync button whose arrows spin while it works, coast to a stop instead of halting, draw a check, and keep "Synced 3 min ago" up to date.

## Ground rules

- Only the props above exist. To change anything else, edit the installed file.
- Keep the files in `components/uibrik/mute-toggle/` so the import paths keep resolving.
- The playbook for working with the whole library: https://uibrik.com/llms.txt
