Please use Desktop to view and interact with components
Components250mseaseInOut
Hover Expand Card
Card that lifts and expands on hover
cardhoverlift
Useto navigate between components
Preview
Beautiful Card
Hover over this card to see it lift and expand with a smooth spring animation.
Code
TypeScript + React
'use client'
import { motion } from 'framer-motion'
export function HoverExpandCard() {
return (
<motion.div
whileHover={{ y: -8, scale: 1.02 }}
transition={{ type: 'spring', stiffness: 300, damping: 20 }}
className="w-80 rounded-2xl border bg-[var(--card-bg)] p-6 shadow-lg transition-shadow hover:shadow-2xl"
>
<div className="mb-4 h-40 rounded-lg bg-gradient-to-br from-slate-400 to-blue-500" />
<h3 className="mb-2 text-xl font-bold">Beautiful Card</h3>
<p className="text-sm text-[var(--foreground)]/70">
Hover over this card to see it lift and expand with a smooth spring
animation.
</p>
</motion.div>
)
}
How to Use
- 1Install Framer Motion:
npm install framer-motion - 2Copy the code from above
- 3Paste it into your project and customize as needed
- 4Colors are customizable via Tailwind CSS classes. The default theme uses dark mode colors defined in your globals.css file