Image Zoom Card
Card with a smooth image zoom on hover and a title overlay at the bottom.
Mountain Sunrise
A gradient study in dawn colors
<div class="group w-full max-w-sm overflow-hidden rounded-2xl shadow-sm">
<div class="relative h-48 overflow-hidden">
<div class="h-full w-full bg-gradient-to-br from-sky-400 via-indigo-500 to-purple-600 transition-transform duration-500 group-hover:scale-110"></div>
<div class="absolute inset-x-0 bottom-0 bg-gradient-to-t from-black/70 to-transparent p-4 pt-10">
<p class="text-lg font-bold text-white">Mountain Sunrise</p>
<p class="text-sm text-white/80">A gradient study in dawn colors</p>
</div>
</div>
</div>Free to use in personal and commercial projects. No attribution required.
Variants
Same component, different looks. Preview each one live and copy the code you like.
Product
The product variant with price and badge fits e-commerce grids and catalog cards.
Ceramic Vase
Handmade stoneware
$48
Top overlay
Move the overlay to the top when the interesting detail sits at the bottom of the image.
Forest Trail
A walk through morning mist
Portrait
The portrait ratio suits story-style feeds and mobile-first galleries.
Neon Nights
City lights collection
About this image zoom card
The image zoom card is a staple of blogs, portfolios, and galleries: a photo that slowly scales up when hovered, with the title sitting on a dark scrim at the bottom. The zoom adds a cinematic feel that makes grids of static cards feel alive.
The zoom comes from group-hover:scale-110 with a 500ms transition on the image layer, clipped by overflow-hidden on the frame so the edges never spill out. The title sits in an absolutely positioned overlay with a bottom-up black gradient, which keeps white text readable over any image. The demo uses a CSS gradient block as the image so it works with zero assets.
Use it for blog post cards, portfolio grids, product collections, and travel galleries. Keep the zoom subtle; 110 percent feels premium while 125 or more starts to feel jumpy.
Grids of static images go flat fast: thirty identical rectangles and the eye stops seeing any of them. A slow zoom on hover adds a cinematic drift that makes each card feel alive and rewards the cursor for exploring. It is the difference between a stock photo grid and a gallery, and it costs one utility class.
The image layer gets group-hover:scale-110 with a 500 millisecond transition, clipped by overflow-hidden on the frame so the enlarged edges never spill onto neighbors. The title sits in an absolutely positioned overlay with a bottom-up black gradient scrim, which keeps white text readable over any photo from bright beaches to dark portraits. The demo uses a CSS gradient as the image so the effect previews with no assets.
Set transform-origin to follow the cursor position for a magnifier effect that feels alive, instead of a dead-center zoom. On product cards, zoom to 1.5 for detail inspection; on editorial cards, keep it at 1.1 for pure atmosphere. Add a quick scale-down on mouse leave rather than snapping back; the 200ms return is what makes it feel physical. Never zoom text overlays along with the image; keep captions in a separate layer so they stay sharp.
Forgetting overflow-hidden on the frame is the classic breakage. Without the clip, the zoomed image bleeds over adjacent cards and text, turning the grid into a messy overlap the moment anyone hovers. The frame must establish the clipping context. If the card has rounded corners, the overflow clip also keeps the zoomed image inside the radius.
Where to use it
- ✓ Blog post cards in article grids
- ✓ Portfolio project thumbnails
- ✓ Product collection tiles in stores
- ✓ Photo gallery and travel album grids
Customization tips
Replace the gradient div with an img tag carrying the same transition and group-hover scale classes, using object-cover to fill the frame. Strengthen or soften the scrim by adjusting from-black/70, and change h-48 to set a taller or shorter frame.
Design notes
When to use
The hover zoom turns a static image card into something tactile, which suits portfolios, property listings, and product grids where the image is the product. The slow scale draws attention to detail without navigating away, and the bottom title overlay keeps the caption readable over any image. It works best when the zoomed area reveals texture worth seeing, like photography or fabric.
What to avoid
Do not zoom images that contain text like screenshots or infographics, the scaled text becomes unreadable and frustrating. Avoid the effect on cards where the image is purely decorative, motion without purpose just adds noise. And do not combine the zoom with three other hover effects, one motion per card is the limit.
Accessibility
Respect prefers-reduced-motion by disabling the zoom and showing the image statically. The image needs descriptive alt text, and the title overlay must keep enough contrast against the image behind it.
Frequently asked questions
Why is overflow-hidden used twice?
The outer one rounds the card corners, and the inner one on the frame clips the zooming image. Without the inner clip, the scaled image would overflow the rounded corners on hover.
Does the zoom work on touch devices?
There is no hover on touch, so the image simply shows at rest, which still looks like a finished card. Nothing about the layout depends on the zoom.
How do I keep the title readable over bright images?
The bottom gradient scrim darkens whatever sits behind the text. For very bright photos, deepen it toward from-black/80 or add a slight text shadow.
How do I zoom an image on hover without shifting the page layout?
Put the image inside a wrapper with overflow hidden and apply the scale transform to the img itself on hover. Because transform does not affect layout, the card and everything around it stays exactly in place. This card does exactly that, which is why the zoom feels like it happens behind glass.
What zoom level looks best for a product card?
Scale 1.05 to 1.1 is the range that feels premium without looking broken. Anything above 1.15 starts cropping important detail and can pixelate the image. Pair it with a 500 to 700ms ease-out transition so the zoom glides instead of snapping.
How do I slow down the zoom for a smoother effect?
Extend the transition duration to duration-700 or duration-1000 and switch the easing to ease-out, which starts fast and settles gently. Keep the reverse, the zoom-out, on the same timing so it does not snap back. Long slow zooms pair well with a subtle brightness lift on the image.
Customize it with our tools
Related elements
Glass card
Frosted glass effect with backdrop blur. Looks best over a colorful background.
Glass Card
Frosted glass card with subtle border and blur.
Hover lift card
Subtle lift plus shadow sells interactivity without layout shift.
Hover Lift Card
Card that lifts with a deepening shadow on hover.
Revenue
$48.2k
12.4%
Stat Card
Metric card with trend indicator.