Get started with chatui-core CDN

MIT licensed

ChatUI-core is a modular chat component library for building conversational interfaces.

Tags:
  • react
  • react-component
  • chat
  • chat-ui

Stable version

Copied!

How to start using chatui-core CDN


// Import the ChatUI library
const ChatUI = require('chatui-core/dist/index.js');

// Create a new ChatUI instance
const chat = new ChatUI({
  el: '#chat-container', // The container element ID
  user: { name: 'You' }, // User name
  avatar: 'url-to-your-avatar', // User avatar URL
  greeting: 'Hello! I am your AI assistant.', // Greeting message
  messages: [], // Initial messages array
  onMessageSend: (message) => {
    // Handle message sending event
    console.log('Message sent:', message);
  },
});

// Start the chat
chat.start();
Copied!
Copied!
Copied!
Copied!

All versions