Tilt Card

A cursor-reactive card wrapper with configurable tilt depth, hover scale, perspective, and optional spotlight.

John Doe

5367 4567 8901 2345

Exp.

12/25

Installation

pnpm dlx shadcn-svelte@latest add https://sv-animations.vercel.app/s/tilt-card.json

Usage

<script lang="ts">	import { TiltCard } from "#lib/components/spell/tilt-card/index.js";</script>
<TiltCard>	<div class="rounded-xl border p-8">Hover me</div></TiltCard>

Props

NameTypeDefaultDescription
tiltLimitnumber15Sets the maximum rotation angle in degrees on both axes.
scalenumber1.05Controls how much the card scales up while hovered.
perspectivenumber1200Sets the CSS perspective distance used for the 3D depth effect.
effect"gravitate" | "evade""evade"Determines whether the card tilts away from the cursor or follows it.
spotlightbooleantrueToggles the radial highlight overlay that tracks the pointer position.
classClassValueundefinedCustom classes applied to the root tilt wrapper.
stylestringundefinedInline styles appended to the root wrapper.