Position of backdrop. Can be either screen or element. Those are equivalent to respectively fixed or absolute class added to backdrop component.
is-opentrue
Boolean
This prop controls visibility state of backdrop. It is true by default so if this prop is not defined backdrop will always be visible.
mod-backdropempty string
String
Style of main backdrop element
nameempty string
String
Name of the component
variantempty string
String
Active variant of the element mod-* props
Slots
default
Slot to place content inside backdrop.
Notes
v-backdrop is used internally to display dimmed background in the components like v-modal or v-sidepanel. Alternatively it can be used on top of the other elements to add an overlay effect. For more examples see modal documentation.
Example - show overlay on hover
Example cardSubtitle
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.
<template><v-cardwidth="320px"class="mx-auto overflow-hidden"
><img:src="randomPhoto()"alt=""
/><headerclass="px-6 pt-3 text-lg font-semibold">Example card</header><headerclass="px-6 py-1 text-sm text-gray-500">Subtitle</header><divclass="p-6">
Lorem Ipsum is simply dummy text of the printing and typesetting industry.
Lorem Ipsum has been the industry's standard dummy text ever since the
1500s, when an unknown printer took a galley of type and scrambled it to
make a type specimen book.
</div><v-divider /><divclass="px-3 py-2 text-sm">Card footer</div><v-backdropfill="element"class="flex items-center justify-center opacity-0 group-hover:opacity-100"mod-backdrop="variant:gradient transition:opacity"
><v-button>Details</v-button></v-backdrop></v-card></template>
<script setup>
let id = [1015, 1016, 1040, 1043, 1067, 155, 158, 179, 184, 191];
letrandomPhoto = (w = 360, h = 240) =>
`https://picsum.photos/id/${id[(Math.random() * 9).toFixed(0)]}/${w}/${h}`;
</script>
Example - pointer events
When adding overlay for visual effect purpose only set pointer-events-none to allow events to pass to underlying elements.
Example cardSubtitle
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.
<template><v-cardwidth="320px"class="mx-auto overflow-hidden"
><img:src="randomPhoto()"alt=""
/><headerclass="px-6 pt-3 text-lg font-semibold">Example card</header><headerclass="px-6 py-1 text-sm text-gray-500">Subtitle</header><divclass="p-6">
Lorem Ipsum is simply dummy text of the printing and typesetting industry.
Lorem Ipsum has been the industry's standard dummy text ever since the
1500s, when an unknown printer took a galley of type and scrambled it to
make a type specimen book.
</div><v-divider /><divclass="px-3 py-2 text-sm">Card footer</div><v-backdropfill="element"class="pointer-events-none flex items-center justify-center opacity-0 group-hover:opacity-100"mod-backdrop="variant:gradientDiagonal transition:opacity"
></v-backdrop></v-card></template>
<script setup>
let id = [1015, 1016, 1040, 1043, 1067, 155, 158, 179, 184, 191];
letrandomPhoto = (w = 360, h = 240) =>
`https://picsum.photos/id/${id[(Math.random() * 9).toFixed(0)]}/${w}/${h}`;
</script>