Skip to content

Modal

EModal is a modal window that appears momentarily on top of the main screen. It pauses the current app operation to request the user for a response.

The main screen is blocked while the modal is active. Returning to the main window requires a user action or confirmation. Demo Here

Usage

vue

<template>
  <EBtn @click="isModalShown = !isModalShown">Open Modal</EBtn>
  <EModal v-model="isModalShown">
    <template #header> Modal title</template>
    <template #body>
      Modal content
    </template>
  </EModal>
</template>

<script setup>
  const isModalShown = ref(false);
</script>

The type of v-model is Boolean.

Props

For EModal component, the following props are available:

PropTypeDefaultNote
teleportBooleantrueEnables vue teleport.
blurEffectBooleantrueApplies background blur.
scrollableBooleanfalseActivates overflow-y-auto.
widthString-Sets the component's width.
heightString-Sets the component's height.
squareBooleanfalseRemoves rounded corners of the element.
closeIconBooleanfalseAdds close icon to modal header.
maxHeightString-Sets the component's max height.
modelValueBooleanfalseControls the visible/hidden state of modal.
disablePageScrollBooleantrueDisables page scrolling when modal is open.
persistentBooleanfalsepersistent EModal is not discarded when touching outside.
sizeString"md"The EModal element has three predefined sizes: sm, md, lg.
animationString"component-pop-out"The EMenu element can be animated in many ways. Defined animations here.
positionString"center-center"The EModal element can appear from the center-center, center-right, center-left, top-center, top-right, top-left, bottom-center, bottom-right, bottom-left, edge of the viewport.

Emits

The EModal component contains following emits.

EmitDescription
update:modelValueEmitted when the local ref's value is mutated.

Slots

The EModal component provides following slots that enable you to customize the content.

SlotDescription
headerThe slot used for the header of the modal.
bodyThe slot used for the modal card body.
footerThe slot used for the modal card footer.

COPYRIGHT