LiveKit docs › Hooks › useDisconnectButton

---

# useDisconnectButton

The `useDisconnectButton` hook is used to implement the `DisconnectButton` or your custom implementation of it. It adds onClick handler to the button to disconnect from the room.

## Import

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

```

## Usage

```tsx
const { buttonProps } = useDisconnectButton(buttonProps);
return <button {...buttonProps}>Disconnect</button>;

```

## Properties

- **`props.stopTracks`** _(boolean)_ (optional): 

## Returns

```typescript
{
    buttonProps: DisconnectButtonProps & {
        className: string;
        onClick: () => void;
        disabled: boolean;
    };
}

```

---

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

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