Contents
- Setting width
- Setting height
- cssClass
Having trouble getting help?
Contact Support
Contact Support
Appearance in EJ2 JavaScript AI AssistView control
13 Dec 20249 minutes to read
Setting width
You can use the width property to set the width of the AI AssistView. The default value is 100%
.
ej.base.enableRipple(true);
// Initializes the AI Assist control
var aiAssistView = new ej.interactivechat.AIAssistView({
width: '650px',
promptRequest: function () {
setTimeout(function () {
var defaultResponse = 'For real-time prompt processing, connect the AIAssistView component to your preferred AI service, such as OpenAI or Azure Cognitive Services. Ensure you obtain the necessary API credentials to authenticate and enable seamless integration.';
aiAssistView.addPromptResponse(defaultResponse);
}, 1000);
}
});
// Render initialized AI Assist.
aiAssistView.appendTo('#width');
<!DOCTYPE html>
<html lang="en">
<head>
<title>EJ2 AI AssistView</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="TypeScript AI AssistView Control" />
<meta name="author" content="Syncfusion" />
<link href="index.css" rel="stylesheet" />
<link href="https://cdn.syncfusion.com/ej2/29.1.33/ej2-base/styles/material.css" rel="stylesheet" />
<link href="https://cdn.syncfusion.com/ej2/29.1.33/ej2-interactive-chat/styles/material.css" rel="stylesheet" />
<link href="https://cdn.syncfusion.com/ej2/29.1.33/ej2-inputs/styles/material.css" rel="stylesheet" />
<link href="https://cdn.syncfusion.com/ej2/29.1.33/ej2-buttons/styles/material.css" rel="stylesheet" />
<link href="https://cdn.syncfusion.com/ej2/29.1.33/ej2-navigations/styles/material.css" rel="stylesheet" />
<link href="https://cdn.syncfusion.com/ej2/29.1.33/ej2-notifications/styles/material.css" rel="stylesheet" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/systemjs/0.19.38/system.js"></script>
<script src="https://cdn.syncfusion.com/ej2/29.1.33/dist/ej2.min.js" type="text/javascript"></script>
<script src="systemjs.config.js"></script>
<script src="https://cdn.syncfusion.com/ej2/syncfusion-helper.js" type ="text/javascript"></script>
</head>
<body>
<div id='loader'>Loading....</div>
<div id='container' style="height: 350px;">
<div id="width"></div>
</div>
</body>
</html>
Setting height
You can use the height property to set the height of the AI AssistView. The default value is 100%
.
ej.base.enableRipple(true);
// Initializes the AI Assist control
var aiAssistView = new ej.interactivechat.AIAssistView({
height: '350px',
promptRequest: function () {
setTimeout(function () {
var defaultResponse = 'For real-time prompt processing, connect the AIAssistView component to your preferred AI service, such as OpenAI or Azure Cognitive Services. Ensure you obtain the necessary API credentials to authenticate and enable seamless integration.';
aiAssistView.addPromptResponse(defaultResponse);
}, 1000);
}
});
// Render initialized AI Assist.
aiAssistView.appendTo('#height');
<!DOCTYPE html>
<html lang="en">
<head>
<title>EJ2 AI AssistView</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="TypeScript AI AssistView Control" />
<meta name="author" content="Syncfusion" />
<link href="index.css" rel="stylesheet" />
<link href="https://cdn.syncfusion.com/ej2/29.1.33/ej2-base/styles/material.css" rel="stylesheet" />
<link href="https://cdn.syncfusion.com/ej2/29.1.33/ej2-interactive-chat/styles/material.css" rel="stylesheet" />
<link href="https://cdn.syncfusion.com/ej2/29.1.33/ej2-inputs/styles/material.css" rel="stylesheet" />
<link href="https://cdn.syncfusion.com/ej2/29.1.33/ej2-buttons/styles/material.css" rel="stylesheet" />
<link href="https://cdn.syncfusion.com/ej2/29.1.33/ej2-navigations/styles/material.css" rel="stylesheet" />
<link href="https://cdn.syncfusion.com/ej2/29.1.33/ej2-notifications/styles/material.css" rel="stylesheet" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/systemjs/0.19.38/system.js"></script>
<script src="https://cdn.syncfusion.com/ej2/29.1.33/dist/ej2.min.js" type="text/javascript"></script>
<script src="systemjs.config.js"></script>
<script src="https://cdn.syncfusion.com/ej2/syncfusion-helper.js" type ="text/javascript"></script>
</head>
<body>
<div id='loader'>Loading....</div>
<div id='container' style="width: 650px;">
<div id="height"></div>
</div>
</body>
</html>
cssClass
You can customize the appearance of the AI AssistView control by using the cssClass property.
ej.base.enableRipple(true);
// Initializes the AI Assist control
var aiAssistView = new ej.interactivechat.AIAssistView({
cssClass: 'custom-container',
promptRequest: function () {
setTimeout(function () {
var defaultResponse = 'For real-time prompt processing, connect the AIAssistView component to your preferred AI service, such as OpenAI or Azure Cognitive Services. Ensure you obtain the necessary API credentials to authenticate and enable seamless integration.';
aiAssistView.addPromptResponse(defaultResponse);
}, 1000);
}
});
// Render initialized AI Assist.
aiAssistView.appendTo('#cssclass');
<!DOCTYPE html>
<html lang="en">
<head>
<title>EJ2 AI AssistView</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="TypeScript AI AssistView Control" />
<meta name="author" content="Syncfusion" />
<link href="index.css" rel="stylesheet" />
<link href="https://cdn.syncfusion.com/ej2/29.1.33/ej2-base/styles/material.css" rel="stylesheet" />
<link href="https://cdn.syncfusion.com/ej2/29.1.33/ej2-interactive-chat/styles/material.css" rel="stylesheet" />
<link href="https://cdn.syncfusion.com/ej2/29.1.33/ej2-inputs/styles/material.css" rel="stylesheet" />
<link href="https://cdn.syncfusion.com/ej2/29.1.33/ej2-buttons/styles/material.css" rel="stylesheet" />
<link href="https://cdn.syncfusion.com/ej2/29.1.33/ej2-navigations/styles/material.css" rel="stylesheet" />
<link href="https://cdn.syncfusion.com/ej2/29.1.33/ej2-notifications/styles/material.css" rel="stylesheet" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/systemjs/0.19.38/system.js"></script>
<script src="https://cdn.syncfusion.com/ej2/29.1.33/dist/ej2.min.js" type="text/javascript"></script>
<script src="systemjs.config.js"></script>
<style>
.e-aiassistview.custom-container {
border-color: #e0e0e0;
background-color: #f4f4f4;
box-shadow: 3px 3px 10px 0px rgba(0, 0, 0, 0.2);
}
.e-aiassistview.custom-container .e-view-header .e-toolbar, .e-aiassistview.custom-container .e-view-header .e-toolbar-items {
background: #d5d5d5;
}
.e-aiassistview.custom-container .e-view-content .e-input-group {
border: 3px solid #e0e0e0 !important;
}
</style>
<script src="https://cdn.syncfusion.com/ej2/syncfusion-helper.js" type ="text/javascript"></script>
</head>
<body>
<div id='loader'>Loading....</div>
<div id='container' style="height: 350px; width: 650px;">
<div id="cssclass"></div>
</div>
</body>
</html>