A simple and clean chat interface built with React 19. Type a message and get an instant response from an AI-powered chatbot, with smooth auto-scroll and a minimal UI.
Live demo: vscrm.github.io/React-Chatbot
- Real-time chat with an AI chatbot powered by the
supersimpledevpackage - Distinct UI layout for user and bot messages with avatars
- Auto-scroll to the latest message on every update
- Send messages via the Send button or by pressing Enter
- Clean, minimal interface with responsive layout
| Technology | Version | Purpose |
|---|---|---|
| React | 19 | UI library and component state management |
| Vite | 8 | Build tool and dev server with HMR |
| supersimpledev | 8.x | AI chatbot engine (Chatbot.getResponse()) |
| gh-pages | 6.x | Automated deployment to GitHub Pages from the dist folder |
| ESLint | 10 | Code linting with React Hooks and React Refresh plugins |
React-Chatbot/
βββ public/
β βββ Logo.svg
βββ src/
β βββ assets/
β β βββ robot.png # Bot avatar
β β βββ user.png # User avatar
β βββ components/
β β βββ chats/
β β βββ ChatInput.jsx # Text input + Send button, calls Chatbot.getResponse()
β β βββ ChatInput.css
β β βββ ChatMessage.jsx # Single message bubble with avatar
β β βββ ChatMessage.css
β β βββ ChatMessages.jsx # Scrollable message list with auto-scroll
β β βββ ChatMessages.css
β βββ App.jsx # Root component, holds chatMessages state
β βββ App.css
β βββ index.css # Global styles
β βββ main.jsx # Entry point
βββ .gitignore
βββ eslint.config.js
βββ index.html
βββ LICENSE
βββ package-lock.json
βββ package.json
βββ README.md
βββ vite.config.js # Build config with base path for GitHub Pages
- The user types a message in
ChatInputand presses Send or Enter - The message is added to
chatMessagesstate inApp.jsxas{ sender: 'user', ... } Chatbot.getResponse(inputText)from thesupersimpledevpackage is called synchronously- The bot response is appended to
chatMessagesas{ sender: 'robot', ... } ChatMessagesuses auseRef+useEffectto auto-scroll to the bottom on every update- Each message is rendered by
ChatMessage, which picks the correct avatar based onsender
# Install dependencies
npm install
# Start dev server
npm run dev
# Build for production
npm run build
# Deploy to GitHub Pages
npm run deployThe app is deployed to GitHub Pages via the gh-pages package.
npm run deploy
# Builds the project and pushes /dist to the gh-pages branch automaticallyvite.config.js is configured with base: '/React-Chatbot/' to match the GitHub Pages URL structure.
This project was built while following the SuperSimpleDev React course β a practical, beginner-friendly guide to learning modern React from scratch.
- πΊ Course video: youtube.com/watch?v=TtPXvEcE11E
- π» Course GitHub: github.com/SuperSimpleDev/react-course
Thank you to SuperSimpleDev for the open-source materials and the supersimpledev npm package that powers the chatbot engine in this project. π