DisconnectButton
function DisconnectButton(__namedParameters): Element;Defined in: packages/react/src/components/controlbar/DisconnectButton.tsx:38
The DisconnectButton is a basic html button with the added ability to disconnect from a room. Normally this is the big red button that allows end users to leave the video or audio call.
Parameters
| Parameter | Type |
|---|---|
__namedParameters | DisconnectButtonProps |
Returns
Element
Example
// Basic — leave the current room.
<VoiceRoom agent={agent}>
<DisconnectButton onLeave={() => room.disconnect()}>Leave room</DisconnectButton>
</VoiceRoom>
// Advanced — show connection state beside a leave action.
function LeaveControls() {
return (
<VoiceRoom agent={agent}>
<ConnectionState />
<DisconnectButton stopTracks>Leave room</DisconnectButton>
<RoomAudioRenderer />
</VoiceRoom>
);
}