@brainfi.sh/react-chat-widget
TypeScript icon, indicating that this package has built-in type declarations

0.0.2 • Public • Published

Install

npm install @brainfi.sh/chat-widget @brainfi.sh/react-chat-widget

Standard

import { Standard } from '@brainfi.sh/react-chat-widget'

const App = () => {
  return (
    <Standard
      chatAppId="lead-generation-copy-3luzm6b"
      style={{ width: '100%', height: '600px' }}
    />
  )
}

This code is creating a container with a 100% width (will match parent width) and 600px height.

Popup

import { Popup } from '@brainfi.sh/react-chat-widget'

const App = () => {
  return <Popup chatAppId="lead-generation-copy-3luzm6b" autoShowDelay={3000} />
}

This code will automatically trigger the popup window after 3 seconds.

Open or Close a popup

You can use these commands:

import { open } from '@brainfi.sh/react-chat-widget'

open()
import { close } from '@brainfi.sh/react-chat-widget'

close()
import { toggle } from '@brainfi.sh/react-chat-widget'

toggle()

Bubble

import { Bubble } from '@brainfi.sh/react-chat-widget'

const App = () => {
  return (
    <Bubble
      chatAppId="lead-generation-copy-3luzm6b"
      theme={{
        button: { backgroundColor: '#0042DA', iconColor: '#FFFFFF' },
        previewMessage: { backgroundColor: '#ffffff', textColor: 'black' },
      }}
    />
  )
}

This code will show the bubble and let a preview message appear after 5 seconds.

Open or close the chat window

You can use these commands:

import { open } from '@brainfi.sh/react-chat-widget'

open()
import { close } from '@brainfi.sh/react-chat-widget'

close()
import { toggle } from '@brainfi.sh/react-chat-widget'

toggle()

Readme

Keywords

none

Package Sidebar

Install

npm i @brainfi.sh/react-chat-widget

Weekly Downloads

2

Version

0.0.2

License

ISC

Unpacked Size

11.8 kB

Total Files

20

Last publish

Collaborators

  • ajainvivek