alibaba/ChatUI

The UI design language and React library for Conversational UI

📚 Quick Overview

ChatUI is an open‑source React component library that provides a ready‑made, customizable UI for building chat‑style interfaces (think customer‑service bots, virtual assistants, or any conversational app). It bundles UI patterns, theming, accessibility, and i18n support so developers can focus on the conversational logic rather than hand‑crafting chat bubbles, input bars, and navigation.


🎯 Who It’s For

  • Front‑end engineers who need a polished chat UI out of the box.
  • Product teams building AI‑powered chatbots or voice assistants and want a consistent look across browsers and devices.
  • Anyone who wants a TypeScript‑ready, themable, and accessible chat component without starting from scratch.

🛠 Core Features (as described in the README)

Feature What It Means
Best Practices UI patterns distilled from Alibaba’s Alime chatbot experience.
TypeScript Full type definitions for safer development.
Responsive Layout adapts automatically to desktop, mobile, and web‑view environments.
Accessibility Certified support for screen readers and keyboard navigation.
Theming Deep theme customization – colours, fonts, spacing, etc.
Internationalization Built‑in i18n for dozens of languages.
Browser Support Works on modern browsers and IE‑11 (with polyfills).

🚀 Getting Started (from the README)

# Install the package
npm install @chatui/core --save   # or yarn add @chatui/core

Minimal Example

import Chat, { Bubble, useMessages } from '@chatui/core';
import '@chatui/core/dist/index.css';

const App = () => {
  const { messages, appendMsg, setTyping } = useMessages([]);

  const 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);
    }
  };

  const renderMessageContent = msg => <Bubble content={msg.content.text} />;

  return (
    <Chat
      navbar={{ title: 'Assistant' }}
      messages={messages}
      renderMessageContent={renderMessageContent}
     
    />
  );
};

The demo can be tried live on CodeSandbox (link in README).


📦 What’s Inside the Package

  • Chat component – the main container handling message list, input bar, and optional navbar.
  • Bubble – a styled message bubble used in custom renderers.
  • useMessages hook – simple state management for message arrays and typing indicators.
  • CSS – pre‑built styles that respect CSS variables for easy theming.

🎨 Customisation

  • Theme – detailed guide at https://chatui.io/docs/customize-theme (supports colour palettes, font sizes, radius, etc.).
  • i18n – localisation guide at https://chatui.io/docs/i18n.

📜 License

MIT – free to use, modify, and distribute.


✅ Bottom Line

ChatUI is a focused, production‑grade UI kit for conversational interfaces. It doesn’t provide AI models or backend services; instead, it gives developers a solid front‑end foundation so they can plug in any chatbot engine (OpenAI, Rasa, custom LLM, etc.) and deliver a polished, accessible chat experience quickly.

Related

  • Project
  • Project
  • Project
  • Project