@lg-chat/chat-window
TypeScript icon, indicating that this package has built-in type declarations

3.0.9 • Public • Published

Chat Window

Installation

Yarn

yarn add @lg-chat/chat-window

NPM

npm install @lg-chat/chat-window

Example

const Example = (props) => {
  const userName = "Sean Park";
  const [messages, setMessages] = useState<Array<any>>(baseMessages);

  const handleMessageSend = (messageBody: string) => {
    const newMessage = {
      messageBody,
      userName,
    };
    setMessages((messages) => [...messages, newMessage]);
  };

  return (
    <LeafyGreenChatProvider>
      <ChatWindow {...props}>
        <TitleBar title="LG Chat Demo" badgeText="Beta" />
        <MessageFeed>
          {messages.map((messageFields) => (
            <MyMessage key={messageFields.id} {...messageFields} />
          ))}
        </MessageFeed>
        <InputBar onMessageSend={handleMessageSend} />
      </ChatWindow>
    </LeafyGreenChatProvider>
  );
};

Properties

Prop Type Description Default
darkMode boolean Determines if the component should render in dark mode false
... HTMLElementProps<'div'> Props spread on root element

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
3.0.977latest

Version History

VersionDownloads (Last 7 Days)Published
3.0.977
3.0.87
3.0.75
3.0.65
3.0.58
3.0.44
3.0.34
3.0.239
3.0.14
3.0.04
2.0.1188
2.0.03

Package Sidebar

Install

npm i @lg-chat/chat-window

Weekly Downloads

348

Version

3.0.9

License

Apache-2.0

Unpacked Size

463 kB

Total Files

33

Last publish

Collaborators

  • brookescarlett
  • stephl3
  • thesonofthomp
  • _tsck
  • shaneeza