1.0.0-alpha • Published 4 years ago

botui v1.0.0-alpha

Weekly downloads
524
License
MIT
Repository
github
Last release
4 years ago

logo

npm npm Twitter Follow

A JavaScript framework for creating conversational UIs.

Main Site - Read Docs - Examples

🚨 Note

This version is using a completely different approach for building UIs. Do no use it as a drop-in replacement for the previous version.

Example usage in React

import { useEffect } from 'react'
import { createRoot } from 'react-dom/client'

import { createBot } from 'botui'
import { BotUI, BotUIMessageList, BotUIAction, useBotUI } from '@botui/react'

const myBot = createBot()
<div id="botui-app"></div>
const App = () => {

  useEffect(() => {
    myBot.message.add({
      text: 'hey'
    })
      .then(() => myBot.wait({ waitTime: 1000 }))
      .then(() => myBot.message.add({ text: 'what is your name?' }))
      .then(() =>
        myBot.action.set(
          {
            options: [
              { label: 'John', value: 'john' },
              { label: 'Jane', value: 'jane' },
            ],
          },
          { input: 'select' }
        )
      )
      .then((data) =>
        myBot.message.add({ text: `nice to meet you ${data.text}` })
      )
  }, [])

  return <div>
    <BotUI bot={myBot}>
      <BotUIMessageList />
      <BotUIAction />
    </BotUI>
  </div>
}

const containerElement = document.getElementById('botui-app')
const root = createRoot(containerElement)
root.render(<App />)

License

MIT License - Copyrights (c) 2017-22 - Moin Uddin

1.1.1

4 years ago

1.1.0

4 years ago

1.0.5

4 years ago

1.1.3

4 years ago

1.0.4

4 years ago

1.1.2

4 years ago

1.0.1-alpha

4 years ago

1.0.2-alpha

4 years ago

1.0.0-alpha

4 years ago

0.3.9

7 years ago

0.3.8

7 years ago

0.3.7

7 years ago

0.3.6

8 years ago

0.3.5

8 years ago

0.3.4

9 years ago

0.3.3

9 years ago

0.3.2

9 years ago

0.3.1

9 years ago

0.3.0

9 years ago

0.2.2

9 years ago

0.2.1

9 years ago

0.2.0

9 years ago

0.1.5

9 years ago

0.1.4

9 years ago

0.1.3

9 years ago

0.1.2

9 years ago

0.1.1

9 years ago

0.1.0

9 years ago