Skip to content

Canvas

ECanvas is similar to the EModal component, often hidden and displayed when triggered. However, off-canvas is frequently used as a sidebar navigation menu. Demo Here

Usage

vue

<template>
  <EBtn @click="isCanvasShown = !isCanvasShown">Open Canvas</EBtn>
  <ECanvas v-model="isCanvasShown">
    <template #header> Canvas title</template>
    <template #body>
      Canvas content
    </template>
  </ECanvas>
</template>

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

The type of v-model is Boolean.

Props

For ECanvas component, the following props are available:

PropTypeDefaultNote
teleportBooleantrueEnables vue teleport.
blurEffectBooleantrueApplies background blur.
widthString-Sets the component's width.
heightString-Sets the component's height.
bodyClassesString-Overrides or extends the component's body styles.
squareBooleanfalseRemoves rounded corners of the element.
closeIconBooleantrueAdds close icon to canvas header.
modelValueBooleanfalseControls the visible/hidden state of canvas.
persistentBooleanfalsepersistent ECanvas is not discarded when touching outside.
positionString"left"The ECanvas element can appear from the left, right, top or bottom edge of the viewport.

Emits

The ECanvas component contains following emits.

EmitDescription
update:modelValueToggles canvas active state.

Slots

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

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

COPYRIGHT