Animations
ScaleOnHover
Scale an element up on hover and down slightly on tap/click.
Quick Preview
Hover me!
Installation
npm install framer-motion
// Copy fromsrc/components/animations/ScaleOnHover.tsx
Examples
Image card
Hover to scale
Great for cards and images
Button group
Prompt Preview
Copy a prompt that recreates this UI
Paste this into your AI coding assistant to generate code that closely matches the reference, including color, size, shape, typography, spacing, and polish.
Copy-ready AI prompt
Starts from the current visual reference and project constraints.
Tweak only product-specific copy or data after the first generation pass.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
children* | React.ReactNode | - | Content to scale |
scale | number | 1.05 | Scale factor on hover |
tapScale | number | 0.97 | Scale factor on press/tap |
duration | number | 0.2 | Transition duration (seconds) |
className | string | - | Additional CSS classes |