lg-chat Chat Window
npm install @lg-chat/chat-window``shell`
pnpm add @lg-chat/chat-window
`shell`
yarn add @lg-chat/chat-window
`shell`
npm install @lg-chat/chat-window
`tsx
import { ChatWindow } from '@lg-chat/chat-window';
import { LeafyGreenChatProvider } from '@lg-chat/leafygreen-chat-provider';
import { Message } from '@lg-chat/message';
import { MessageFeed } from '@lg-chat/message-feed';
import { InputBar } from '@lg-chat/input-bar';
const Example = props => {
const [messages, setMessages] = useState
const handleMessageSend = (messageBody: string) => {
const newMessage = {
messageBody,
};
setMessages(messages => [...messages, newMessage]);
};
return (
{messages.map(messageFields => (
))}
);
};
`
| Prop | Type | Description | Default |
| ---------- | ------------------------- | ------------------------------------------------------ | ------- |
| darkMode | boolean | Determines if the component should render in dark mode | false |...
| | HTMLElementProps<'div'>` | Props spread on root element | |