Contents
- Setting placeholder
- Setting width
- Setting height
- CssClass
Having trouble getting help?
Contact Support
Contact Support
Appearance in Vue Chat UI component
18 Dec 202415 minutes to read
Setting placeholder
You can use the placeholder property to display the placeholder text that appears in the message input field to guide users on what to type. The default is Type your message…
.
<template>
<div id='container' style="height: 380px; width: 450px; margin: 0 auto;">
<ejs-chatui placeholder="Start typing..." :user="currentUser">
<e-messages>
<e-message :author="currentUser" text="Hi Michale, are we on track for the deadline?"></e-message>
<e-message :author="michaleUser" text="Yes, the design phase is complete."></e-message>
<e-message :author="currentUser" text="I’ll review it and send feedback by today."></e-message>
</e-messages>
</ejs-chatui>
</div>
</template>
<script setup>
import { ChatUIComponent as EjsChatui, MessagesDirective as EMessages, MessageDirective as EMessage } from "@syncfusion/ej2-vue-interactive-chat";
const currentUser = {
id: "user1",
user: "Albert"
};
const michaleUser = {
id: "user2",
user: "Michale Suyama"
};
</script>
<style>
@import "../node_modules/@syncfusion/ej2-base/styles/material.css";
@import "../node_modules/@syncfusion/ej2-inputs/styles/material.css";
@import "../node_modules/@syncfusion/ej2-navigations/styles/material.css";
@import "../node_modules/@syncfusion/ej2-buttons/styles/material.css";
@import "../node_modules/@syncfusion/ej2-popups/styles/material.css";
@import "../node_modules/@syncfusion/ej2-interactive-chat/styles/material.css";
</style>
<template>
<div id='container' style="height: 380px; width: 450px; margin: 0 auto;">
<ejs-chatui placeholder="Start typing..." :user="currentUser">
<e-messages>
<e-message :author="currentUser" text="Hi Michale, are we on track for the deadline?"></e-message>
<e-message :author="michaleUser" text="Yes, the design phase is complete."></e-message>
<e-message :author="currentUser" text="I’ll review it and send feedback by today."></e-message>
</e-messages>
</ejs-chatui>
</div>
</template>
<script>
import { ChatUIComponent, MessagesDirective, MessageDirective } from "@syncfusion/ej2-vue-interactive-chat";
export default {
components: {
'ejs-chatui': ChatUIComponent,
'e-messages': MessagesDirective,
'e-message': MessageDirective
},
data() {
return {
currentUser: {
id: "user1",
user: "Albert",
},
michaleUser: {
id: "user2",
user: "Michale Suyama",
}
};
},
};
</script>
<style>
@import "../node_modules/@syncfusion/ej2-base/styles/material.css";
@import "../node_modules/@syncfusion/ej2-inputs/styles/material.css";
@import "../node_modules/@syncfusion/ej2-navigations/styles/material.css";
@import "../node_modules/@syncfusion/ej2-buttons/styles/material.css";
@import "../node_modules/@syncfusion/ej2-popups/styles/material.css";
@import "../node_modules/@syncfusion/ej2-interactive-chat/styles/material.css";
</style>
Setting width
You can use the width property to specify the dimensions of the Chat UI within the application layout. By default, the value is 100%
.
<template>
<div id='container' style="height: 380px; margin: 0 auto;">
<ejs-chatui width="450px" :user="currentUser">
<e-messages>
<e-message :author="currentUser" text="Hi Michale, are we on track for the deadline?"></e-message>
<e-message :author="michaleUser" text="Yes, the design phase is complete."></e-message>
<e-message :author="currentUser" text="I’ll review it and send feedback by today."></e-message>
</e-messages>
</ejs-chatui>
</div>
</template>
<script setup>
import { ChatUIComponent as EjsChatui, MessagesDirective as EMessages, MessageDirective as EMessage } from "@syncfusion/ej2-vue-interactive-chat";
const currentUser = {
id: "user1",
user: "Albert"
};
const michaleUser = {
id: "user2",
user: "Michale Suyama"
};
</script>
<style>
@import "../node_modules/@syncfusion/ej2-base/styles/material.css";
@import "../node_modules/@syncfusion/ej2-inputs/styles/material.css";
@import "../node_modules/@syncfusion/ej2-navigations/styles/material.css";
@import "../node_modules/@syncfusion/ej2-buttons/styles/material.css";
@import "../node_modules/@syncfusion/ej2-popups/styles/material.css";
@import "../node_modules/@syncfusion/ej2-interactive-chat/styles/material.css";
</style>
<template>
<div id='container' style="height: 380px; margin: 0 auto;">
<ejs-chatui width="450px" :user="currentUser">
<e-messages>
<e-message :author="currentUser" text="Hi Michale, are we on track for the deadline?"></e-message>
<e-message :author="michaleUser" text="Yes, the design phase is complete."></e-message>
<e-message :author="currentUser" text="I’ll review it and send feedback by today."></e-message>
</e-messages>
</ejs-chatui>
</div>
</template>
<script>
import { ChatUIComponent, MessagesDirective, MessageDirective } from "@syncfusion/ej2-vue-interactive-chat";
export default {
components: {
'ejs-chatui': ChatUIComponent,
'e-messages': MessagesDirective,
'e-message': MessageDirective
},
data() {
return {
currentUser: {
id: "user1",
user: "Albert",
},
michaleUser: {
id: "user2",
user: "Michale Suyama",
}
};
},
};
</script>
<style>
@import "../node_modules/@syncfusion/ej2-base/styles/material.css";
@import "../node_modules/@syncfusion/ej2-inputs/styles/material.css";
@import "../node_modules/@syncfusion/ej2-navigations/styles/material.css";
@import "../node_modules/@syncfusion/ej2-buttons/styles/material.css";
@import "../node_modules/@syncfusion/ej2-popups/styles/material.css";
@import "../node_modules/@syncfusion/ej2-interactive-chat/styles/material.css";
</style>
Setting height
You can use the height property to specify the dimensions of the Chat UI within the application layout. By default, the value is 100%
.
<template>
<div id='container' style="width: 450px; margin: 0 auto;">
<ejs-chatui height='380px' :user="currentUser">
<e-messages>
<e-message :author="currentUser" text="Hi Michale, are we on track for the deadline?"></e-message>
<e-message :author="michaleUser" text="Yes, the design phase is complete."></e-message>
<e-message :author="currentUser" text="I’ll review it and send feedback by today."></e-message>
</e-messages>
</ejs-chatui>
</div>
</template>
<script setup>
import { ChatUIComponent as EjsChatui, MessagesDirective as EMessages, MessageDirective as EMessage } from "@syncfusion/ej2-vue-interactive-chat";
const currentUser = {
id: "user1",
user: "Albert"
};
const michaleUser = {
id: "user2",
user: "Michale Suyama"
};
</script>
<style>
@import "../node_modules/@syncfusion/ej2-base/styles/material.css";
@import "../node_modules/@syncfusion/ej2-inputs/styles/material.css";
@import "../node_modules/@syncfusion/ej2-navigations/styles/material.css";
@import "../node_modules/@syncfusion/ej2-buttons/styles/material.css";
@import "../node_modules/@syncfusion/ej2-popups/styles/material.css";
@import "../node_modules/@syncfusion/ej2-interactive-chat/styles/material.css";
</style>
<template>
<div id='container' style="width: 450px; margin: 0 auto;">
<ejs-chatui height='380px' :user="currentUser">
<e-messages>
<e-message :author="currentUser" text="Hi Michale, are we on track for the deadline?"></e-message>
<e-message :author="michaleUser" text="Yes, the design phase is complete."></e-message>
<e-message :author="currentUser" text="I’ll review it and send feedback by today."></e-message>
</e-messages>
</ejs-chatui>
</div>
</template>
<script>
import { ChatUIComponent, MessagesDirective, MessageDirective } from "@syncfusion/ej2-vue-interactive-chat";
export default {
components: {
'ejs-chatui': ChatUIComponent,
'e-messages': MessagesDirective,
'e-message': MessageDirective
},
data() {
return {
currentUser: {
id: "user1",
user: "Albert",
},
michaleUser: {
id: "user2",
user: "Michale Suyama",
}
};
},
};
</script>
<style>
@import "../node_modules/@syncfusion/ej2-base/styles/material.css";
@import "../node_modules/@syncfusion/ej2-inputs/styles/material.css";
@import "../node_modules/@syncfusion/ej2-navigations/styles/material.css";
@import "../node_modules/@syncfusion/ej2-buttons/styles/material.css";
@import "../node_modules/@syncfusion/ej2-popups/styles/material.css";
@import "../node_modules/@syncfusion/ej2-interactive-chat/styles/material.css";
</style>
CssClass
You can use the cssClass property to customize the appearance of the chat UI component.
<template>
<div id='container' style="height: 380px; width: 450px; margin: 0 auto;">
<ejs-chatui cssClass='custom-container' :user="currentUser">
<e-messages>
<e-message :author="currentUser" text="Hi Michale, are we on track for the deadline?"></e-message>
<e-message :author="michaleUser" text="Yes, the design phase is complete."></e-message>
<e-message :author="currentUser" text="I’ll review it and send feedback by today."></e-message>
</e-messages>
</ejs-chatui>
</div>
</template>
<script setup>
import { ChatUIComponent as EjsChatui, MessagesDirective as EMessages, MessageDirective as EMessage } from "@syncfusion/ej2-vue-interactive-chat";
const currentUser = {
id: "user1",
user: "Albert"
};
const michaleUser = {
id: "user2",
user: "Michale Suyama"
};
</script>
<style>
@import "../node_modules/@syncfusion/ej2-base/styles/material.css";
@import "../node_modules/@syncfusion/ej2-inputs/styles/material.css";
@import "../node_modules/@syncfusion/ej2-navigations/styles/material.css";
@import "../node_modules/@syncfusion/ej2-buttons/styles/material.css";
@import "../node_modules/@syncfusion/ej2-popups/styles/material.css";
@import "../node_modules/@syncfusion/ej2-interactive-chat/styles/material.css";
.custom-container {
border-color: #e0e0e0;
background-color: #f4f4f4;
box-shadow: 3px 3px 10px 0px rgba(0, 0, 0, 0.2);
}
.custom-container .e-chat-header {
background: #0c888e;
}
.custom-container .e-footer .e-input-group {
border: 3px solid #bde0e2;
}
</style>
<template>
<div id='container' style="height: 380px; width: 450px; margin: 0 auto;">
<ejs-chatui cssClass='custom-container' :user="currentUser">
<e-messages>
<e-message :author="currentUser" text="Hi Michale, are we on track for the deadline?"></e-message>
<e-message :author="michaleUser" text="Yes, the design phase is complete."></e-message>
<e-message :author="currentUser" text="I’ll review it and send feedback by today."></e-message>
</e-messages>
</ejs-chatui>
</div>
</template>
<script>
import { ChatUIComponent, MessagesDirective, MessageDirective } from "@syncfusion/ej2-vue-interactive-chat";
export default {
components: {
'ejs-chatui': ChatUIComponent,
'e-messages': MessagesDirective,
'e-message': MessageDirective
},
data() {
return {
currentUser: {
id: "user1",
user: "Albert",
},
michaleUser: {
id: "user2",
user: "Michale Suyama",
}
};
},
};
</script>
<style>
@import "../node_modules/@syncfusion/ej2-base/styles/material.css";
@import "../node_modules/@syncfusion/ej2-inputs/styles/material.css";
@import "../node_modules/@syncfusion/ej2-navigations/styles/material.css";
@import "../node_modules/@syncfusion/ej2-buttons/styles/material.css";
@import "../node_modules/@syncfusion/ej2-popups/styles/material.css";
@import "../node_modules/@syncfusion/ej2-interactive-chat/styles/material.css";
.custom-container {
border-color: #e0e0e0;
background-color: #f4f4f4;
box-shadow: 3px 3px 10px 0px rgba(0, 0, 0, 0.2);
}
.custom-container .e-chat-header {
background: #0c888e;
}
.custom-container .e-footer .e-input-group {
border: 3px solid #bde0e2;
}
</style>