2.4.14-beta.3 β’ Published 1 year ago
simmslabschatui v2.4.14-beta.3
Features
- π Best Practices: The best practice for chat interaction based on our experience of Alime Chatbot
- π‘ TypeScript: Written in TypeScript with predictable static types
- π± Responsive: Responsive design to adapt automatically to whatever device
- βΏ Accessibility: Accessibility support and get the certification from Accessibility Research Association
- π¨ Theming: Powerful theme customization in every detail
- π International: Internationalization support for dozens of languages
Environment Support
- Modern browsers (support CSS Variables)
- Internet Explorer 11 (with polyfills and CSS Variables Polyfill / css-vars-ponyfill)
Edge | Firefox | Chrome | Safari | iOS Safari | Android WebView |
---|---|---|---|---|---|
16+ | 31+ | 49+ | 9.1+ | 9.3+ | 6+ |
Install
npm install simmslabschatui --save
yarn add simmslabschatui
Usage
import Chat, { Bubble, useMessages } from 'simmslabschatui';
import 'simmslabschatui/dist/index.css';
const App = () => {
const { messages, appendMsg, setTyping } = useMessages([]);
function handleSend(type, val) {
if (type === 'text' && val.trim()) {
appendMsg({
type: 'text',
content: { text: val },
position: 'right',
});
setTyping(true);
setTimeout(() => {
appendMsg({
type: 'text',
content: { text: 'Bala bala' },
});
}, 1000);
}
}
function renderMessageContent(msg) {
const { content } = msg;
return <Bubble content={content.text} />;
}
return (
<Chat
navbar={{ title: 'Assistant' }}
messages={messages}
renderMessageContent={renderMessageContent}
onSend={handleSend}
/>
);
};
Development
cd storybook
npm i
npm run storybook
License
MIT
2.4.14-beta.3
1 year ago
2.4.14-beta.2
1 year ago
2.4.14-beta.1
1 year ago
2.4.13-beta.0
1 year ago
2.4.11-beta.0
1 year ago
2.4.10-beta.0
1 year ago
2.4.9-beta.0
1 year ago