Chat
function Chat(__namedParameters): Element;Defined in: packages/react/src/components/chat/Chat.tsx:49
The Chat component provides ready-to-use chat functionality in a room. Messages are distributed to all participants in the room in real-time.
Parameters
| Parameter | Type |
|---|---|
__namedParameters | ChatProps |
Returns
Element
Example
// Basic — render room chat.
<VoiceRoom agent={agent}>
<Chat />
</VoiceRoom>
// Advanced — place chat beside the default controls.
function RoomWithChat() {
const tracks = useTracks([Track.Source.Camera]);
return (
<VoiceRoom agent={agent}>
<GridLayout tracks={tracks}>
<ParticipantTile />
</GridLayout>
<Chat />
<ControlBar />
</VoiceRoom>
);
}