Quick Start
Get started with ADP Chat Component quickly
Quick Start
This guide will help you quickly integrate ADP Chat Component into your project.
Installation
The component library is not yet published to npm. You need to install it locally.
Option 1: Local File Reference
- Copy the
adp-chat-componentdirectory to your project - Add local dependency in
package.json:
- Install dependencies:
Option 2: Monorepo Workspace
If your project uses pnpm workspace or other monorepo solutions, place the component library in the packages directory:
Then reference it in your project:
Option 3: Direct Build Output Import
If you only need to use the built output, you can directly import files from the dist directory:
Or in JavaScript:
Basic Usage
Using in Simple HTML Pages
Create ADPChat using API. See API Reference for API parameters.
- Import adpchat js and css
- Create an element with id like chat-container to bindADPChat ADPChat will render based on chat-container layout
- Initialize adpchat
Using in Vue Projects
2.1 Quick Creation with API (Recommended)
Manage components through init, update, unmount methods.
a. Create mount container
b. Create useChat Composable to manage component lifecycle
c. Style configuration
2.2 Using ADPChat Component (JSX Style)
Use Vue component directly:
2.3 Custom Assembly with Basic Components
Refer to the basic components documentation
Using in React or Other Frameworks
Since adp-chat-component is a Vue-based component library, integration in React or other frameworks requires using the mounting API.
3.1 Quick Creation with API (Recommended)
Similar to using API in Vue projects, you can manage components through init, update, unmount methods.
a. Create mount container
b. Create useChat Hook to manage component lifecycle
c. Style configuration
3.2 Wrap as React Component (JSX Style)
If you prefer using JSX component style, you can wrap a React component that internally calls ADPChat.mount to mount the Vue component.
a. Wrap ADPChat React Component
b. Use in page
Theme Switching
Components support light and dark themes:
Internationalization
Customize text through i18n related props: