- Alert dimension
- Confirm dimension
- Prompt dimension
- Max-width and max-height
- Min-width and min-height
Contact Support
Dimension in Vue Predefined dialogs component
11 Jun 202413 minutes to read
Customize the predefined dialogs dimensions using the height and width properties.
You can specify the dimension values in both pixels and percentage format to change the default dialog width and height values.
Alert dimension
<template>
<div class="predefinedDialogs">
<ejs-button id="alertDlgBtn" v-on:click="alertBtnClick" cssClass="e-danger">Alert</ejs-button>
</div>
</template>
<script setup>
import { DialogUtility } from "@syncfusion/ej2-vue-popups";
import { ButtonComponent as EjsButton } from "@syncfusion/ej2-vue-buttons";
const alertBtnClick = () => {
DialogUtility.alert({
title: 'Not enough space',
width: '300px',
height: '200px',
content: 'Delete certain files to free up space to store more items.'
});
};
</script>
<style>
@import "../node_modules/@syncfusion/ej2-vue-popups/styles/material.css";
.predefinedDialogs {
height: 100%;
min-height: 350px;
}
</style>
<template>
<div class="predefinedDialogs">
<ejs-button id="alertDlgBtn" v-on:click="alertBtnClick" cssClass="e-danger">Alert</ejs-button>
</div>
</template>
<script>
import { DialogUtility } from "@syncfusion/ej2-vue-popups";
import { ButtonComponent } from "@syncfusion/ej2-vue-buttons";
export default {
name: "App",
components: {
"ejs-button": ButtonComponent
},
data: function () {
return {};
},
methods: {
alertBtnClick: function () {
DialogUtility.alert({
title: 'Not enough space',
width: '300px',
height: '200px',
content: 'Delete certain files to free up space to store more items.'
});
},
},
}
</script>
<style>
@import "../node_modules/@syncfusion/ej2-vue-popups/styles/material.css";
.predefinedDialogs {
height: 100%;
min-height: 350px;
}
</style>
Confirm dimension
<template>
<div class="predefinedDialogs">
<ejs-button id="confirmDlgBtn" v-on:click="confirmBtnClick" cssClass="e-success">Confirm</ejs-button>
</div>
</template>
<script setup>
import { DialogUtility } from "@syncfusion/ej2-vue-popups";
import { ButtonComponent as EjsButton } from "@syncfusion/ej2-vue-buttons";
const confirmBtnClick = () => {
DialogUtility.confirm({
title: 'Delete multiple items',
content: "Are you sure you want to permanently delete these items?",
width: '300px',
height: '200px'
});
};
</script>
<style>
@import "../node_modules/@syncfusion/ej2-vue-popups/styles/material.css";
.predefinedDialogs {
height: 100%;
min-height: 350px;
}
</style>
<template>
<div class="predefinedDialogs">
<ejs-button id="confirmDlgBtn" v-on:click="confirmBtnClick" cssClass="e-success">Confirm</ejs-button>
</div>
</template>
<script>
import { DialogUtility } from "@syncfusion/ej2-vue-popups";
import { ButtonComponent } from "@syncfusion/ej2-vue-buttons";
export default {
name: "App",
components: {
"ejs-button": ButtonComponent
},
data: function () {
return {};
},
methods: {
confirmBtnClick: function () {
DialogUtility.confirm({
title: 'Delete multiple items',
content: "Are you sure you want to permanently delete these items?",
width: '300px',
height: '200px'
});
},
},
}
</script>
<style>
@import "../node_modules/@syncfusion/ej2-vue-popups/styles/material.css";
.predefinedDialogs {
height: 100%;
min-height: 350px;
}
</style>
Prompt dimension
<template>
<div class="predefinedDialogs">
<ejs-button id="promptDlgBtn" v-on:click="promptBtnClick" :isPrimary="true">Prompt</ejs-button>
</div>
</template>
<style>
@import "../node_modules/@syncfusion/ej2-vue-popups/styles/material.css";
.predefinedDialogs {
height: 100%;
min-height: 350px;
}
</style>
<script setup>
import { DialogUtility } from "@syncfusion/ej2-vue-popups";
import { ButtonComponent as EjsButton } from "@syncfusion/ej2-vue-buttons";
const promptBtnClick = () => {
DialogUtility.confirm({
title: 'Join chat group',
width: '300px',
height: '250px',
content: '<p>Enter your name: </p><input id= "inputEle" type="text" name="Required" class="e-input" placeholder="Type here.." />'
});
};
</script>
<template>
<div class="predefinedDialogs">
<ejs-button id="promptDlgBtn" v-on:click="promptBtnClick" :isPrimary="true">Prompt</ejs-button>
</div>
</template>
<script>
import { DialogUtility } from "@syncfusion/ej2-vue-popups";
import { ButtonComponent } from "@syncfusion/ej2-vue-buttons";
export default {
name: "App",
components: {
"ejs-button":ButtonComponent
},
data: function () {
return {};
},
methods: {
promptBtnClick: function () {
DialogUtility.confirm({
title: 'Join chat group',
width: '300px',
height: '250px',
content: '<p>Enter your name: </p><input id= "inputEle" type="text" name="Required" class="e-input" placeholder="Type here.." />'
});
},
},
}
</script>
<style>
@import "../node_modules/@syncfusion/ej2-vue-popups/styles/material.css";
.predefinedDialogs {
height: 100%;
min-height: 350px;
}
</style>
Max-width and max-height
To have a restricted max-width and max-height dialog dimension, you need to specify the max-width, max-height CSS properties for the component’s container element by using the cssClass property. The max-height value is calculated in source level and set to the dialog. so, need to override the max-height property.
Use the following code to customize the max-width and max-height for alert dialog:
<template>
<div class="predefinedDialogs">
<ejs-button id="alertDlgBtn" v-on:click="alertBtnClick" cssClass="e-danger">Alert</ejs-button>
</div>
</template>
<script setup>
import { DialogUtility } from "@syncfusion/ej2-vue-popups";
import { ButtonComponent as EjsButton } from "@syncfusion/ej2-vue-buttons";
const alertBtnClick = () => {
DialogUtility.alert({
title: 'About syncfusion succinctly series',
content: 'In the Succinctly series, Syncfusion created a robust, free library of more than 130 technical e-books formatted for PDF, Kindle, and EPUB.Each title in the Succinctly series is written by a carefully chosen expert and provides essential content in about 100 pages. The Succinctly series was born in 2012 out of a desire to provide concise technical e-books for software developers.',
cssClass: 'customClass'
});
};
</script>
<style>
@import "../node_modules/@syncfusion/ej2-vue-popups/styles/material.css";
.predefinedDialogs {
height: 100%;
min-height: 350px;
}
.e-alert-dialog.customClass {
max-width: 350px;
max-height: 250px !important;
}
</style>
<template>
<div class="predefinedDialogs">
<ejs-button id="alertDlgBtn" v-on:click="alertBtnClick" cssClass="e-danger">Alert</ejs-button>
</div>
</template>
<script>
import { DialogUtility } from "@syncfusion/ej2-vue-popups";
import { ButtonComponent } from "@syncfusion/ej2-vue-buttons";
export default {
name: "App",
components: {
"ejs-button": ButtonComponent
},
data: function () {
return {};
},
methods: {
alertBtnClick: function () {
DialogUtility.alert({
title: 'About syncfusion succinctly series',
content: 'In the Succinctly series, Syncfusion created a robust, free library of more than 130 technical e-books formatted for PDF, Kindle, and EPUB.Each title in the Succinctly series is written by a carefully chosen expert and provides essential content in about 100 pages. The Succinctly series was born in 2012 out of a desire to provide concise technical e-books for software developers.',
cssClass: 'customClass'
});
},
},
}
</script>
<style>
@import "../node_modules/@syncfusion/ej2-vue-popups/styles/material.css";
.predefinedDialogs {
height: 100%;
min-height: 350px;
}
.e-alert-dialog.customClass {
max-width: 350px;
max-height: 250px !important;
}
</style>
Min-width and min-height
To have a restricted min-width and min-height dialog dimension, you need to specify the min-width, min-height CSS properties for the component’s container element by using the cssClass
property.
Use the following code to customize the min-width and min-height for alert dialog:
<template>
<div class="predefinedDialogs">
<ejs-button id="alertDlgBtn" v-on:click="alertBtnClick" cssClass="e-danger">Alert</ejs-button>
</div>
</template>
<script setup>
import { DialogUtility } from "@syncfusion/ej2-vue-popups";
import { ButtonComponent as EjsButton } from "@syncfusion/ej2-vue-buttons";
const alertBtnClick = () => {
DialogUtility.alert({
title: "About syncfusion succinctly series",
content: "The succinctly series was born in 2012.",
cssClass: "customClass",
});
};
</script>
<style>
@import "../node_modules/@syncfusion/ej2-vue-popups/styles/material.css";
.predefinedDialogs {
height: 100%;
min-height: 350px;
}
.e-dialog.customClass {
min-width: 300px;
min-height: 200px;
}
</style>
<template>
<div class="predefinedDialogs">
<ejs-button id="alertDlgBtn" v-on:click="alertBtnClick" cssClass="e-danger">Alert</ejs-button>
</div>
</template>
<script>
import { DialogUtility } from "@syncfusion/ej2-vue-popups";
import { ButtonComponent } from "@syncfusion/ej2-vue-buttons";
export default {
name: "App",
components: {
"ejs-button": ButtonComponent
},
data: function () {
return {};
},
methods: {
alertBtnClick: function () {
DialogUtility.alert({
title: "About syncfusion succinctly series",
content: "The succinctly series was born in 2012.",
cssClass: "customClass",
});
},
},
}
</script>
<style>
@import "../node_modules/@syncfusion/ej2-vue-popups/styles/material.css";
.predefinedDialogs {
height: 100%;
min-height: 350px;
}
.e-dialog.customClass {
min-width: 300px;
min-height: 200px;
}
</style>