
Security News
rv Is a New Rust-Powered Ruby Version Manager Inspired by Python's uv
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
@cmnd-ai/chatbot-react
Advanced tools
A fully customizable React chatbot component with conversation management, themes, and custom components support.
npm install @cmnd-ai/chatbot-react
or
yarn add @cmnd-ai/chatbot-react
import CmndChatBot from "@cmnd-ai/chatbot-react";
import "@cmnd-ai/chatbot-react/dist/styles/index.css";
const App = () => {
return (
<CmndChatBot
chatbotId={123}
organizationId={456}
apiKey="your-api-key"
baseUrl="https://api.example.com"
/>
);
};
import CmndChatBot from "@cmnd-ai/chatbot-react";
import { FaUserCircle } from "react-icons/fa";
import { BsRobot, BsTools } from "react-icons/bs";
import "@cmnd-ai/chatbot-react/dist/styles/index.css";
const App = () => {
return (
<CmndChatBot
chatbotId={123}
organizationId={456}
apiKey="your-api-key"
baseUrl="https://api.example.com"
theme="dark"
Components={{
// Custom avatar components
BotAvatar: () => <BsRobot size={24} color="#373E4E" />,
UserAvatar: () => <FaUserCircle size={24} color="#7A8194" />,
ToolAvatar: () => <BsTools size={24} color="#FF6B6B" />,
// Custom loading indicator
LoadingIndicator: () => <div>🤔 Thinking...</div>,
// Custom input field
InputField: ({ input, setInput, canSendMessage, handleSendClick }) => (
<input
type="text"
value={input}
onChange={(e) => setInput(e.target.value)}
disabled={!canSendMessage}
onKeyPress={(e) => e.key === "Enter" && handleSendClick()}
placeholder="Type your message..."
style={{
padding: "12px",
borderRadius: "8px",
border: "1px solid #ccc",
}}
/>
),
// Custom send button
SendButton: ({ canSendMessage, handleSendClick }) => (
<button
onClick={handleSendClick}
disabled={!canSendMessage}
style={{
padding: "12px 24px",
backgroundColor: canSendMessage ? "#373E4E" : "#ccc",
color: "white",
border: "none",
borderRadius: "8px",
cursor: canSendMessage ? "pointer" : "not-allowed",
}}
>
Send
</button>
),
}}
customStyles={{
// Custom styling
panelStyle: { backgroundColor: "#f5f5f5" },
chatbubbleStyle: { borderRadius: "12px" },
botChatbubbleStyle: { backgroundColor: "#373E4E" },
userChatbubbleStyle: { backgroundColor: "#7A8194" },
}}
/>
);
};
Prop | Type | Description |
---|---|---|
chatbotId | number | Your chatbot ID |
organizationId | number | Your organization ID |
baseUrl | string | Your CMND API base URL |
apiKey | string | Your API key for authentication |
Prop | Type | Default | Description |
---|---|---|---|
theme | "light" | "dark" | "light" | Theme for the chatbot |
UITools | CMNDChatbotUITool[] | [] | Array of UI tools |
enabledTools | any[] | [] | Array of enabled tools |
initialMemory | CMNDChatMemory | undefined | Initial conversation memory |
customStyles | CustomStyles | undefined | Custom CSS styles |
Components | Components | undefined | Custom component overrides |
You can replace any UI component with your own implementation:
Components={{
BotAvatar: () => <YourBotIcon />,
UserAvatar: () => <YourUserIcon />,
ToolAvatar: () => <YourToolIcon />
}}
Components={{
InputField: ({ input, setInput, canSendMessage, handleSendClick }) => (
<YourCustomInput />
),
SendButton: ({ canSendMessage, handleSendClick }) => (
<YourCustomButton />
)
}}
Components={{
LoadingIndicator: () => <YourCustomLoader />
}}
You can customize the appearance using the customStyles
prop:
customStyles={{
// Panel and layout styles
panelStyle: { backgroundColor: '#f5f5f5' },
sidebarStyle: { width: '350px' },
conversationListStyle: { padding: '16px' },
// Header styles
headerStyle: { padding: '20px' },
newChatButtonStyle: { backgroundColor: '#007bff' },
refreshButtonStyle: { backgroundColor: '#28a745' },
// Conversation card styles
conversationCardStyle: { borderRadius: '8px' },
activeConversationCardStyle: { borderColor: '#007bff' },
titleStyle: { fontSize: '16px' },
dateStyle: { fontSize: '12px' },
deleteButtonStyle: { color: '#dc3545' },
// Chat bubble styles
chatbubbleStyle: { borderRadius: '12px' },
botChatbubbleStyle: { backgroundColor: '#373E4E' },
userChatbubbleStyle: { backgroundColor: '#7A8194' },
chatAvatarStyle: { fontSize: '24px' },
// Input styles
inputStyle: { padding: '12px' },
sendButtonStyle: { backgroundColor: '#373E4E' }
}}
The chatbot automatically handles:
The chatbot supports light and dark themes with automatic color schemes:
customStyles
Support for both UI and backend tools:
const UITools = [
{
name: "calculator",
description: "Perform calculations",
category: "utility",
argumentSchema: {
type: "object",
properties: {
expression: { type: "string", description: "Math expression" },
},
},
runCmd: ({ functionArgs }) => {
// Your tool implementation
},
},
];
For more detailed examples and implementations, check out our example repository.
We welcome contributions! Please feel free to submit a Pull Request.
This project is licensed under the MIT License.
FAQs
## Getting Started (Development)
We found that @cmnd-ai/chatbot-react demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.
Security News
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.