Skip to content
Cards Fancy Stable

DirectionAwareHover

.md

Image card with overlay that slides in from the mouse entry direction

Available for Svelte 5, React, and Vue 3.

Preview

Installation

pnpm add fancy-ui-svelte
import { DirectionAwareHover } from "fancy-ui-svelte";

Usage

svelte
<script lang="ts">
	import { DirectionAwareHover } from "fancy-ui-svelte";
</script>

<DirectionAwareHover
	imageUrl="https://images.unsplash.com/photo-1506905925346-21bda4d32df4?w=800&q=80"
>
	<p class="text-xl font-bold">Mountain Peak</p>
	<p class="text-sm font-normal">Swiss Alps, Switzerland</p>
</DirectionAwareHover>

Examples

Basic Usage

Multiple Cards

Props

PropTypeDefaultDescription
imageUrl *string-URL of the background image
imageAlt string"image"Alt text for the image
childrenClass string""CSS classes for the overlay content wrapper
imageClass string""CSS classes for the image element

Slots

SlotDescription
children Content shown in the overlay when hovered