Skip to content

Commit e056bcd

Browse files
Source Files
1 parent af7d287 commit e056bcd

File tree

17 files changed

+734
-2
lines changed

17 files changed

+734
-2
lines changed

README.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,11 @@
1-
# build-interactive-chat-uis-in-react-supercharge-your-app-experience
2-
This sample project demonstrates an interactive chat application built with the Syncfusion React Chat UI Component. It showcases dynamic message switching, bot response integration, a customizable header toolbar, and a responsive splitter layout for seamless navigation.
1+
# Build Interactive Chat UIs in React – Supercharge Your App Experience
2+
This sample project demonstrates an interactive chat application built with the Syncfusion React Chat UI Component. It showcases dynamic message switching, bot response integration, a customizable header toolbar, and a responsive splitter layout for seamless navigation. The chat UI adapts across devices, offering a user-friendly experience for multi-user conversations. Designed for educational and demo purposes, this project serves as a starting point for developers to create engaging, customizable chat interfaces in React applications.
3+
4+
## Prerequisites
5+
* Visual Studio Code
6+
* Node.js and React latest version
7+
8+
## How to run the project
9+
* Checkout this project to a location in your disk.
10+
* Open the project file using Visual Studio 2022.
11+
* Run commands npm install and npm start.

chat-ui-react/package.json

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
{
2+
"name": "chat-ui-react",
3+
"version": "0.1.0",
4+
"private": true,
5+
"dependencies": {
6+
"@syncfusion/ej2-react-buttons": "^29.2.5",
7+
"@syncfusion/ej2-react-interactive-chat": "^29.2.4",
8+
"@syncfusion/ej2-react-layouts": "^29.2.4",
9+
"@syncfusion/ej2-react-lists": "^29.2.4",
10+
"@testing-library/dom": "^10.4.0",
11+
"@testing-library/jest-dom": "^6.6.3",
12+
"@testing-library/react": "^16.3.0",
13+
"@testing-library/user-event": "^13.5.0",
14+
"react": "^19.1.0",
15+
"react-dom": "^19.1.0",
16+
"react-scripts": "5.0.1",
17+
"web-vitals": "^2.1.4"
18+
},
19+
"scripts": {
20+
"start": "react-scripts start",
21+
"build": "react-scripts build",
22+
"test": "react-scripts test",
23+
"eject": "react-scripts eject"
24+
},
25+
"eslintConfig": {
26+
"extends": [
27+
"react-app",
28+
"react-app/jest"
29+
]
30+
},
31+
"browserslist": {
32+
"production": [
33+
">0.2%",
34+
"not dead",
35+
"not op_mini all"
36+
],
37+
"development": [
38+
"last 1 chrome version",
39+
"last 1 firefox version",
40+
"last 1 safari version"
41+
]
42+
}
43+
}

chat-ui-react/public/favicon.ico

3.78 KB
Binary file not shown.

chat-ui-react/public/index.html

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8" />
5+
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1" />
7+
<meta name="theme-color" content="#000000" />
8+
<meta
9+
name="description"
10+
content="Web site created using create-react-app"
11+
/>
12+
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
13+
<link href="https://cdn.syncfusion.com/ej2/29.1.33/tailwind3.css" rel="stylesheet">
14+
<!--
15+
manifest.json provides metadata used when your web app is installed on a
16+
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
17+
-->
18+
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
19+
<!--
20+
Notice the use of %PUBLIC_URL% in the tags above.
21+
It will be replaced with the URL of the `public` folder during the build.
22+
Only files inside the `public` folder can be referenced from the HTML.
23+
24+
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
25+
work correctly both with client-side routing and a non-root public URL.
26+
Learn how to configure a non-root public URL by running `npm run build`.
27+
-->
28+
<title>React App</title>
29+
</head>
30+
<body>
31+
<noscript>You need to enable JavaScript to run this app.</noscript>
32+
<div id="root"></div>
33+
<!--
34+
This HTML file is a template.
35+
If you open it directly in the browser, you will see an empty page.
36+
37+
You can add webfonts, meta tags, or analytics to this file.
38+
The build step will place the bundled scripts into the <body> tag.
39+
40+
To begin the development, run `npm start` or `yarn start`.
41+
To create a production bundle, use `npm run build` or `yarn build`.
42+
-->
43+
</body>
44+
</html>

chat-ui-react/public/logo192.png

5.22 KB
Loading

chat-ui-react/public/logo512.png

9.44 KB
Loading

chat-ui-react/public/manifest.json

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"short_name": "React App",
3+
"name": "Create React App Sample",
4+
"icons": [
5+
{
6+
"src": "favicon.ico",
7+
"sizes": "64x64 32x32 24x24 16x16",
8+
"type": "image/x-icon"
9+
},
10+
{
11+
"src": "logo192.png",
12+
"type": "image/png",
13+
"sizes": "192x192"
14+
},
15+
{
16+
"src": "logo512.png",
17+
"type": "image/png",
18+
"sizes": "512x512"
19+
}
20+
],
21+
"start_url": ".",
22+
"display": "standalone",
23+
"theme_color": "#000000",
24+
"background_color": "#ffffff"
25+
}

chat-ui-react/public/robots.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# https://www.robotstxt.org/robotstxt.html
2+
User-agent: *
3+
Disallow:

chat-ui-react/src/App.css

Lines changed: 163 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,163 @@
1+
.integration-chatui {
2+
width: 85%;
3+
height: 600px;
4+
margin: 150px auto;
5+
}
6+
7+
.integration-chatui .chat-leftContent {
8+
display: flex;
9+
height: 100%;
10+
}
11+
12+
.integration-chatui .chat-rightContent {
13+
height: 100%;
14+
}
15+
16+
.integration-chatui .toggle-chat-listview.e-card:hover {
17+
background: none;
18+
}
19+
20+
.integration-chatui .toggle-chat-listview {
21+
border: none;
22+
justify-content: flex-start;
23+
border-radius: unset;
24+
line-height: 20px;
25+
box-shadow: none;
26+
}
27+
28+
.integration-chatui .chat-options-container {
29+
display: flex;
30+
flex-direction: column;
31+
background: whitesmoke;
32+
overflow: hidden;
33+
}
34+
35+
.integration-chatui .chat_options {
36+
display: flex;
37+
flex-direction: column;
38+
align-items: center;
39+
border: none;
40+
border-radius: 0;
41+
pointer-events: none;
42+
}
43+
44+
.integration-chatui .chat_options .e-icon-top,
45+
.integration-chatui .e-headertext {
46+
font-size: 20px !important;
47+
}
48+
49+
.integration-chatui .e-list-header {
50+
font-size: 25px;
51+
margin: 8px 0 8px 5px;
52+
border-bottom: 0;
53+
background: unset;
54+
}
55+
56+
.integration-chatui .e-list-container li {
57+
border: none;
58+
}
59+
60+
.integration-chatui .e-list-container {
61+
border-top: 1px solid #d0d0d0;
62+
}
63+
64+
.integration-chatui .e-splitter .e-split-bar.e-split-bar-horizontal:not(.e-resizable-split-bar),
65+
.integration-chatui .e-splitter .e-split-bar-horizontal.e-last-bar,
66+
.integration-chatui .e-list-template li {
67+
margin: 0;
68+
border-radius: 0;
69+
}
70+
71+
.integration-chatui .chat_message {
72+
white-space: nowrap;
73+
overflow: hidden;
74+
text-overflow: ellipsis;
75+
}
76+
77+
.integration-chatui .e-header-icon {
78+
background-color: unset;
79+
}
80+
81+
.integration-chatui .chat_user1_avatar {
82+
background-image: url('https://ej2.syncfusion.com/react/demos/src/chat-ui/images/andrew.png');
83+
}
84+
85+
.integration-chatui .chat_user2_avatar {
86+
background-image: url('https://ej2.syncfusion.com/react/demos/src/chat-ui/images/charlie.png');
87+
}
88+
89+
.integration-chatui .chat_user3_avatar {
90+
background-image: url('https://ej2.syncfusion.com/react/demos/src/chat-ui/images/laura.png');
91+
}
92+
93+
.integration-chatui .chat_user4_avatar {
94+
background-image: url('https://ej2.syncfusion.com/react/demos/src/chat-ui/images/reena.png');
95+
}
96+
97+
.integration-chatui .chat_team_avatar {
98+
background-image: url('https://ej2.syncfusion.com/react/demos/src/chat-ui/images/calendar.png');
99+
}
100+
101+
.integration-chatui .chat_bot_avatar {
102+
background-image: url('https://ej2.syncfusion.com/react/demos/src/chat-ui/images/bot.png');
103+
}
104+
105+
.integration-chatui #listview_template {
106+
border-right: 0;
107+
border-bottom: 0;
108+
border-top: 0;
109+
border-radius: 0;
110+
height: 100%;
111+
}
112+
113+
@font-face {
114+
font-family: 'ChatUIdemo';
115+
src:
116+
url(data:application/x-font-ttf;charset=utf-8;base64,AAEAAAAKAIAAAwAgT1MvMj1tSfUAAAEoAAAAVmNtYXDnE+dkAAABlAAAADxnbHlmqS+qEQAAAdwAAAMcaGVhZCnJluEAAADQAAAANmhoZWEIUQQGAAAArAAAACRobXR4FAAAAAAAAYAAAAAUbG9jYQGCAkYAAAHQAAAADG1heHABEQCsAAABCAAAACBuYW1lChZRfQAABPgAAAIxcG9zdNaOJHIAAAcsAAAAbAABAAAEAAAAAFwEAAAAAAAD9AABAAAAAAAAAAAAAAAAAAAABQABAAAAAQAAt5KxUl8PPPUACwQAAAAAAONbqPgAAAAA41uo+AAAAAAD9AP0AAAACAACAAAAAAAAAAEAAAAFAKAAAgAAAAAAAgAAAAoACgAAAP8AAAAAAAAAAQQAAZAABQAAAokCzAAAAI8CiQLMAAAB6wAyAQgAAAIABQMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUGZFZABA5wDnAwQAAAAAXAQAAAAAAAABAAAAAAAABAAAAAQAAAAEAAAABAAAAAQAAAAAAAACAAAAAwAAABQAAwABAAAAFAAEACgAAAAEAAQAAQAA5wP//wAA5wD//wAAAAEABAAAAAEAAgADAAQAAAAAAKYAuADcAY4AAgAAAAAD6QP0ADIAjAAAAQcfCzM/BBcHLxo1NycPBhUfHjM/Bi8IKwEPAy8IPwM1LwkjDwEBWUgIJh8dIxsdICImGQcEBQUPFFW9cB4sLScsMCMkJiglH0swHhMSCREPDAYEBAQCAoQVC20pCAMBAQICAwQFBQcHBxETExUWIClOLC8uKyknJCIfHSYfHxgFCAkHigQDAQECBAUH3gUFBgYFBgU3NQ8cJiMgJR4jFT4CAgEBAQIDlQUDCAgICAcGAu2PDzkoIiUaGxsaGxADAQEFCzR1lAgQExQZHxcbHiEhHVE5JhwcDx0fHxAQDxAQEBB3QAlgKAoGBgcSExISExISERIRIiEgHx0oL1MpKCQgHBkWE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NpbmcgU3luY2Z1c2lvbiBNZXRybyBTdHVkaW93d3cuc3luY2Z1c2lvbi5jb20AIABDAGgAYQB0AGQAZQBtAG8AUgBlAGcAdQBsAGEAcgBDAGgAYQB0AGQAZQBtAG8AQwBoAGEAdABkAGUAbQBvAFYAZQByAHMAaQBvAG4AIAAxAC4AMABDAGgAYQB0AGQAZQBtAG8ARgBvAG4AdAAgAGcAZQBuAGUAcgBhAHQAZQBkACAAdQBzAGkAbgBnACAAUwB5AG4AYwBmAHUAcwBpAG8AbgAgAE0AZQB0AHIAbwAgAFMAdAB1AGQAaQBvAHcAdwB3AC4AcwB5AG4AYwBmAHUAcwBpAG8AbgAuAGMAbwBtAAAAAAIAAAAAAAAACgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQECAQMBBAEFAQYADnBob25lLWNhbGxzLXdmD3ZpZGVvLXJlY29yZC0wMw92aWRlby1yZWNvcmQtMDQNdGVsZXBob25lLS0wMwAA) format('truetype');
117+
font-weight: normal;
118+
font-style: normal;
119+
}
120+
[class^="chat-icon-"], [class*=" chat-icon-"] {
121+
font-family: 'ChatUIdemo' !important;
122+
}
123+
124+
.integration-chatui .chat-icon-phone-call:before { content: "\e703"; }
125+
126+
body[class*="-dark"] .integration-chatui .chat-options-container,
127+
body[class*="high"] .integration-chatui .chat-options-container {
128+
background: #000;
129+
}
130+
131+
.e-chat-ui .e-message-icon {
132+
top: 15px !important;
133+
}
134+
135+
@media only screen and (max-width: 1200px) {
136+
.integration-chatui {
137+
height: 600px;
138+
width: 100%;
139+
}
140+
.integration-chatui .chat_options .e-btn-icon + span {
141+
display: none;
142+
}
143+
.chat-integration.control-section {
144+
height: 650px;
145+
}
146+
.integration-chatui .toggle-chat-listview {
147+
position: absolute;
148+
top: 0;
149+
width: 300px;
150+
left: 46px;
151+
height: 100%;
152+
z-index: 2000;
153+
border: none;
154+
border-radius: unset;
155+
display: none;
156+
}
157+
.integration-chatui .chat_options.chat_interactable {
158+
pointer-events: auto;
159+
}
160+
.integration-chatui .toggle-chat-listview.e-card:hover {
161+
background: #f6f6f6;
162+
}
163+
}

0 commit comments

Comments
 (0)