Mon 21 Jul 22:43:21 CEST 2025
This commit is contained in:
parent
1de8cad75a
commit
0c597c154a
60
js/ui/botui/README.md
Normal file
60
js/ui/botui/README.md
Normal file
|
@ -0,0 +1,60 @@
|
|||
# BotUI
|
||||
|
||||
[](https://gitter.im/BotUIChat/botui?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [](https://www.npmjs.com/package/botui) [](https://www.npmjs.com/package/botui) [](https://tinyletter.com/moinhq)
|
||||
|
||||
> A JavaScript framework to create conversational UIs.
|
||||
|
||||
|
||||
[Main Site](https://botui.org) - [Read Docs](https://docs.botui.org) - [Examples](https://github.com/moinism/botui-examples)
|
||||
|
||||
## Showcase 🎇✨
|
||||
|
||||
We are listing all the cool projects that people are building with BotUI, [here](https://github.com/botui/botui/blob/master/Showcase.md). See others' and add yours!
|
||||
|
||||
### Quick look
|
||||
|
||||

|
||||
|
||||
```html
|
||||
<div class="botui-app-container" id="botui-app">
|
||||
<bot-ui></bot-ui>
|
||||
</div>
|
||||
```
|
||||
|
||||
```javascript
|
||||
var botui = new BotUI('botui-app'); // give it the id of container
|
||||
|
||||
botui.message.bot({ // show first message
|
||||
delay: 200,
|
||||
content: 'hello'
|
||||
}).then(function () {
|
||||
return botui.message.bot({ // second one
|
||||
delay: 1000, // wait 1 sec.
|
||||
content: 'how are you?'
|
||||
});
|
||||
}).then(function () {
|
||||
return botui.action.button({ // let user do something
|
||||
delay: 1000,
|
||||
action: [
|
||||
{
|
||||
text: 'Good',
|
||||
value: 'good'
|
||||
},
|
||||
{
|
||||
text: 'Really Good',
|
||||
value: 'really_good'
|
||||
}
|
||||
]
|
||||
});
|
||||
}).then(function (res) {
|
||||
return botui.message.bot({
|
||||
delay: 1000,
|
||||
content: 'You are feeling ' + res.text + '!'
|
||||
});
|
||||
});
|
||||
```
|
||||
|
||||
|
||||
### License
|
||||
|
||||
[MIT License](https://github.com/moinism/botui/blob/master/LICENSE) - Copyrights (c) 2017 - Moin Uddin
|
Loading…
Reference in New Issue
Block a user