https://github.com/deftio/yackbox
yackbox is a simple vanilla (no dependancies) JavaScript chat control that can be easily integrated into web applications. It provides a customizable chat interface with support for adding, updating, and removing messages, along with multi-user support and message history controls
https://github.com/deftio/yackbox
chat-control chatbot chatui javascript
Last synced: about 2 months ago
JSON representation
yackbox is a simple vanilla (no dependancies) JavaScript chat control that can be easily integrated into web applications. It provides a customizable chat interface with support for adding, updating, and removing messages, along with multi-user support and message history controls
- Host: GitHub
- URL: https://github.com/deftio/yackbox
- Owner: deftio
- License: other
- Created: 2024-04-08T20:20:05.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-04-13T00:40:34.000Z (about 1 year ago)
- Last Synced: 2024-04-13T02:56:00.323Z (about 1 year ago)
- Topics: chat-control, chatbot, chatui, javascript
- Language: JavaScript
- Homepage: https://deftio.github.io/yackbox
- Size: 97.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# yackbox.js
~ ~ note: alpha version frequent changes ~ ~
yackbox is a simple vanilla (no dependancies) JavaScript chat control that can be easily integrated into web applications. It provides a customizable chat interface with support for adding, updating, and removing messages, along with multi-user support and message history controls.## Features
Add messages with customizable user and alignment options.
Update existing messages with new content.
Remove messages from the chat interface.
Retrieve the chat log. Log contains timestamps for all messages.
Callback function for message events.
Responsive design for various screen sizes.## Installation
To use yackbox in your project, follow these steps:Include the yackbox.js JavaScript file in your project.
Link the yackbox.css stylesheet to style the chat interface.
html```html
```
Create a container element in your HTML where you want the chat interface to appear:
```html
```Initialize yackbox in your JavaScript code by providing the container element and a callback function for message events:
```javascript
const chat = new yackbox('#chat-container', messageCallback);
//Use the provided methods to interact with the chat control:// Add a message
chat.addMessage('Hello!', 'User', 'left'); // user should appear left or right justified// Update a message
chat.updateMessage(1, 'New content');// Remove a message
chat.removeMessage(1);// Get the chat log
const log = chat.getLog();
console.log(log);
```## Usage
Yackbox is highly customizable and can be integrated into various web applications. You can modify the appearance and behavior of the chat interface by adjusting the CSS styles and JavaScript code according to your requirements.## Examples
Included are several examples including:
[Example Code](./examples/index.html)
* UMD and ESM usage in browser
* Multiuser and multiple instance setups
* Using message history and stats
* Streaming and completions based LLM use## Building from Source
Make sure to run npm install. Then run npm run build.
Note that at run time yackbox has no dependancies, but at build time several tools are used for packing and minifying code.## Contributors
## License
yackbox is licensed under the BSD-2 License.