ChatToggle
function ChatToggle(__namedParameters): Element;Defined in: packages/react/src/components/chat/ChatToggle.tsx:37
The ChatToggle component is a button that toggles the visibility of the Chat component.
Parameters
| Parameter | Type |
|---|---|
__namedParameters | ChatToggleProps |
Returns
Element
Example
// Basic — toggle the room chat panel.
<VoiceRoom agent={agent}>
<ChatToggle unread={3} />
</VoiceRoom>
// Advanced — wire chat toggle with the chat surface and controls.
function RoomWithToggleableChat() {
return (
<VoiceRoom agent={agent}>
<ChatToggle />
<Chat />
<ControlBar variation="minimal" />
</VoiceRoom>
);
}