Install & Compatibility
Where this runs
No compatibility data collected yet for this library.
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
Chatbot
✓ import Chatbot from 'mongodb-chatbot-ui'
✗ const Chatbot = require('mongodb-chatbot-ui')
Default export. ESM-only, no CommonJS support.
FloatingActionButtonTrigger
✓ import { FloatingActionButtonTrigger } from 'mongodb-chatbot-ui'
✗ import { FloatingActionButtonTrigger } from 'mongodb-chatbot-ui/FloatingActionButtonTrigger'
Named export, not a subpath import.
ModalView
✓ import { ModalView } from 'mongodb-chatbot-ui'
✗ import ModalView from 'mongodb-chatbot-ui'
Named export, not default.
mongoDbVerifyInformationMessage
✓ import { mongoDbVerifyInformationMessage } from 'mongodb-chatbot-ui'
Named export for a message string.
Demonstrates a full chatbot UI with input bar, floating button, modal view, and legal disclosure component using named and default imports.
import Chatbot, {
FloatingActionButtonTrigger,
InputBarTrigger,
ModalView,
MongoDbLegalDisclosure,
} from 'mongodb-chatbot-ui';
function MyApp() {
const suggestedPrompts = [
'How do I create a new MongoDB Atlas cluster?',
'Can MongoDB store lists of data?',
'How does vector search work?',
];
return (
<Chatbot name="MongoDB AI" maxInputCharacters={300}>
<InputBarTrigger
bottomContent={<MongoDbLegalDisclosure />}
suggestedPrompts={suggestedPrompts}
/>
<FloatingActionButtonTrigger text="Ask the MongoDB Assistant" />
<ModalView
disclaimer={<MongoDbLegalDisclosure />}
initialMessageText="Welcome to the MongoDB Assistant. What can I help you with?"
initialMessageSuggestedPrompts={suggestedPrompts}
inputBottomText="Verify information"
/>
</Chatbot>
);
}
export default MyApp;
Errors
Common errors & fixes
Cannot find module 'mongodb-chatbot-ui' or its corresponding type declarations.
Package not installed or TypeScript cannot resolve module.
fixRun npm install mongodb-chatbot-ui. Ensure tsconfig.json includes 'node' module resolution or 'bundler'.
Attempted import error: 'FloatingActionButtonTrigger' is not exported from 'mongodb-chatbot-ui'.
Using a subpath import like 'mongodb-chatbot-ui/FloatingActionButtonTrigger'.
fixImport from the package root: import { FloatingActionButtonTrigger } from 'mongodb-chatbot-ui'. TypeError: Cannot read properties of undefined (reading 'useChatbotContext')
Using the component outside a <Chatbot> provider.
fixWrap your component tree with <Chatbot>.
Error: Chatbot must have exactly one child of type InputBarTrigger, FloatingActionButtonTrigger, or ModalView.
Multiple ModalView components or missing required child.
fixEnsure exactly one child of the allowed types is passed to <Chatbot>.
Audit
Dependencies
reactrequiredPeer dependency: UI framework
react-domrequiredPeer dependency: required for React DOM rendering