Skip to content

botui/botui

main
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
October 12, 2022 12:50
October 12, 2022 21:39
September 24, 2022 12:49
October 4, 2022 12:23
October 5, 2022 20:31
September 25, 2022 14:49
January 4, 2018 20:50
September 10, 2022 17:38
October 6, 2022 13:32
September 24, 2022 14:55
February 5, 2023 17:33
October 25, 2018 11:36
October 12, 2022 14:01
March 12, 2022 21:21
September 25, 2022 14:49
September 25, 2022 13:09

logo

join discussion npm npm Twitter Follow

A JavaScript framework for creating conversational UIs.

Main Site - Read Docs - Examples - 🪄 Quickstart

Showcase 🎇

We are listing all the cool projects that people are building with BotUI, here. See others' and add yours!

🚨 Note

This version is using a completely different approach for building UIs. Do not use it as a drop-in replacement for the previous version. If you want to use the previous (vue-only) approach, install the 0.3.9 version: npm i botui@0.3.9.

Quick look

preview

Installation

npm i botui @botui/react

Example usage in React

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

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

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

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

  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-23 - Moin Uddin