Registry / communication / mongodb-chatbot-ui

mongodb-chatbot-ui

JSON →
library0.18.3jsnpmunverified

React UI components for building chatbots using MongoDB's retrieval-augmented generation (RAG) framework. Version 0.18.3 (stable, active development). Provides pre-built triggers (FloatingActionButtonTrigger, InputBarTrigger), a ModalView, and legal disclosure components. Designed to integrate with mongodb-chatbot-framework. Ships TypeScript types. React 18 or 19 peer dependency.

npm install mongodb-chatbot-ui
INSTALL
IMPORT
SIG · MONGODB-CHATBOT-UI
M
mongodb-chatbot-ui
communicationjavascriptv0.18.3
harness data pending
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;
Debug
Known issues
deprecateduseChatbotStyles and useChatbotContext hooks may be deprecated; prefer prop-based configuration.
fix
Use component props like `maxInputCharacters` and `name` on <Chatbot> instead of custom hooks.
affects: <=0.18.3
gotchaComponents must be wrapped in a <Chatbot> provider; rendering a trigger or modal outside will throw an error.
fix
Ensure all triggers and the modal are children of <Chatbot>.
affects: >=0.1.0
gotchaThe initialMessageSuggestedPrompts prop on ModalView expects an array of strings, not objects.
fix
Pass string array, e.g., ['Prompt1', 'Prompt2'].
affects: >=0.1.0
breakingRenamed `preferredLanguage` to `language` in v0.16.0.
fix
Use `language` prop instead of `preferredLanguage`.
affects: >=0.16.0
Errors
Common errors & fixes
Cannot find module 'mongodb-chatbot-ui' or its corresponding type declarations.
Package not installed or TypeScript cannot resolve module.
fix
Run 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'.
fix
Import 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.
fix
Wrap 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.
fix
Ensure exactly one child of the allowed types is passed to <Chatbot>.
Upgrade
Version history
0.18.3latest on npm
Audit
Dependencies
reactrequiredPeer dependency: UI framework
react-domrequiredPeer dependency: required for React DOM rendering
Agent activity
10 hits · last 30 days
node
8
OpenAI (training)
1
Resources
mongodb-chatbot-ui — npm install mongodb-chatbot-ui · libregistry