LiveKit docs › Components › TrackToggle

---

# TrackToggle

With the `TrackToggle` component it is possible to mute and unmute your camera and microphone. The component uses an html button element under the hood so you can treat it like a button.

## Import

```typescript
import { TrackToggle } from "@livekit/components-react";

```

## Usage

```tsx
<LiveKitRoom>
  <TrackToggle source={Track.Source.Microphone} />
  <TrackToggle source={Track.Source.Camera} />
</LiveKitRoom>

```

## Properties

- **`source`** _(T)_: 

- **`captureOptions`** _(CaptureOptionsBySource<T>)_ (optional): _(Optional)_

- **`initialState`** _(boolean)_ (optional): _(Optional)_

- **`onChange`** _((enabled: boolean, isUserInitiated: boolean) => void)_ (optional): _(Optional)_ Function that is called when the enabled state of the toggle changes. The second function argument `isUserInitiated` is `true` if the change was initiated by a user interaction, such as a click.

- **`onDeviceError`** _((error: Error) => void)_ (optional): _(Optional)_

- **`publishOptions`** _(TrackPublishOptions)_ (optional): _(Optional)_

- **`showIcon`** _(boolean)_ (optional): _(Optional)_

---

This document was rendered at 2026-06-07T11:32:01.255Z.
For the latest version of this document, see [https://docs.livekit.io/reference/components/react/component/tracktoggle.md](https://docs.livekit.io/reference/components/react/component/tracktoggle.md).

To explore all LiveKit documentation, see [llms.txt](https://docs.livekit.io/llms.txt).