SolutionsCase StudiesAI ToolsResourcesAboutContact
Get Your Free AI Automation Audit Book a Free 30-Minute Strategy Call
Playground~/frontend Open editor

~/css/tailwind-card-hover-effects

6 Tailwind Card Hover Effects

5 Tailwind1 with JSPublished 2026-10-05Free · no sign-up

Six card hovers in Tailwind: a product card whose details panel slides up, a border that turns into a gradient, an image that zooms inside its frame, a spotlight that follows the pointer, a retro offset-shadow card and a plan card that expands to show its features.

01. Tailwind Card with Hover Details Panel

TailwindCardReveal

A product card where a panel with the price and button slides up on hover. On touch screens, which have no hover, an arbitrary media variant shows the panel permanently so nothing is hidden from phone users.

View code
<article class="group relative h-64 w-56 max-w-full overflow-hidden rounded-2xl bg-[linear-gradient(160deg,#fde68a,#fb923c_55%,#be123c)] shadow-lg">
  <h3 class="absolute left-4 top-4 rounded-lg bg-white/90 px-2.5 py-1 text-sm font-bold text-slate-900">Sunset lamp</h3>
  <div class="absolute inset-x-0 bottom-0 translate-y-full bg-white p-4 transition-transform duration-300 group-hover:translate-y-0 group-focus-within:translate-y-0 motion-reduce:transition-none [@media(hover:none)]:translate-y-0">
    <p class="font-bold text-slate-900">$48.00</p>
    <button type="button" class="mt-2 w-full rounded-lg bg-slate-900 py-2 text-sm font-semibold text-white hover:bg-slate-700 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-slate-900">Add to cart</button>
  </div>
</article>

02. Tailwind Gradient Border on Hover

TailwindCardBorder

A plain card whose one-pixel grey frame turns into a gradient on hover. The frame is the wrapper's background showing through p-px around a white inner card, so switching the wrapper to a gradient recolours only the edge.

View code
<a href="#integrations" class="group block w-64 max-w-full rounded-2xl bg-slate-200 p-px transition hover:bg-gradient-to-br hover:from-fuchsia-500 hover:to-cyan-500 focus-visible:bg-gradient-to-br focus-visible:from-fuchsia-500 focus-visible:to-cyan-500 focus-visible:outline-none">
  <div class="rounded-[15px] bg-white p-5">
    <p class="text-xs font-bold uppercase tracking-wider text-fuchsia-700">New</p>
    <h3 class="mt-1 text-lg font-bold text-slate-900">Integrations</h3>
    <p class="mt-1 text-sm text-slate-600">Connect your store to 40 apps in two clicks.</p>
  </div>
</a>

03. Tailwind Card with Zooming Image

TailwindCardImage

The picture inside the card zooms slowly on hover while the frame stays fixed, thanks to overflow-hidden on the image wrapper. The long duration-700 makes the zoom feel calm rather than jumpy.

View code
<a href="#trip" class="group block w-60 max-w-full overflow-hidden rounded-2xl bg-white shadow-md ring-1 ring-slate-200 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-sky-700">
  <div class="overflow-hidden"><div role="img" aria-label="Mountain lake at dawn" class="aspect-[4/3] bg-[linear-gradient(170deg,#bae6fd,#7dd3fc_38%,#0f766e_39%,#134e4a_70%,#0c4a6e_71%)] transition-transform duration-700 group-hover:scale-110 motion-reduce:transition-none"></div></div>
  <div class="p-4"><h3 class="font-bold text-slate-900">Lake Bled in three days</h3><p class="text-sm text-slate-600">An easy itinerary for first-timers.</p></div>
</a>

04. Tailwind Pointer Spotlight Card

TailwindCardSpotlight

A dark card where a soft light follows the pointer across the surface. A script writes the pointer position to two custom properties and an arbitrary radial-gradient utility draws the glow there.

View code
<article data-spot class="group relative w-64 max-w-full overflow-hidden rounded-2xl border border-white/10 bg-slate-900 p-6 text-slate-100">
  <span aria-hidden="true" class="pointer-events-none absolute inset-0 opacity-0 transition-opacity duration-300 group-hover:opacity-100 [background:radial-gradient(240px_circle_at_var(--x,50%)_var(--y,50%),rgba(56,189,248,.2),transparent_60%)]"></span>
  <h3 class="relative text-lg font-bold">Realtime analytics</h3>
  <p class="relative mt-1 text-sm text-slate-300">See every visitor the moment they land, with no sampling.</p>
</article>
var s = document.querySelector('[data-spot]');
s.addEventListener('pointermove', function (e) { var r = s.getBoundingClientRect(); s.style.setProperty('--x', e.clientX - r.left + 'px'); s.style.setProperty('--y', e.clientY - r.top + 'px'); });

05. Tailwind Offset Shadow Card

TailwindCardRetro

A bold card on a solid coloured block offset behind it. On hover the card moves up and left while the block moves down and right, so the gap between them grows like the card is lifting off the page.

View code
<a href="#case" class="group relative block w-60 max-w-[calc(100%-16px)] focus-visible:outline-none">
  <span aria-hidden="true" class="absolute inset-0 translate-x-2 translate-y-2 rounded-xl bg-amber-400 transition-transform duration-200 group-hover:translate-x-3 group-hover:translate-y-3 motion-reduce:transition-none"></span>
  <div class="relative rounded-xl border-2 border-slate-900 bg-white p-5 transition-transform duration-200 group-hover:-translate-x-0.5 group-hover:-translate-y-0.5 group-focus-visible:ring-4 group-focus-visible:ring-indigo-500 motion-reduce:transition-none">
    <p class="text-xs font-black uppercase tracking-wider text-slate-900">Case study</p>
    <h3 class="mt-1 text-lg font-black text-slate-900">Rebuilding a coffee brand's store</h3>
  </div>
</a>

06. Tailwind Card that Expands on Hover

TailwindCardExpand

A plan card that grows to reveal its feature list on hover or when something inside has focus. The list animates height with grid-rows-[0fr] to grid-rows-[1fr], and touch screens always show it open.

View code
<article class="group w-64 max-w-full rounded-2xl bg-white p-5 shadow-md ring-1 ring-slate-200">
  <h3 class="text-lg font-bold text-slate-900">Team plan</h3>
  <p class="text-sm text-slate-600">$12 per seat, billed monthly</p>
  <div class="grid grid-rows-[0fr] transition-[grid-template-rows] duration-300 group-hover:grid-rows-[1fr] group-focus-within:grid-rows-[1fr] motion-reduce:transition-none [@media(hover:none)]:grid-rows-[1fr]">
    <ul class="overflow-hidden text-sm text-slate-700"><li class="mt-3">✓ Shared workspaces</li><li class="mt-1">✓ Admin controls</li><li class="mt-1">✓ Priority support</li></ul>
  </div>
  <a href="#team" class="mt-4 inline-block rounded-lg bg-indigo-600 px-4 py-2 text-sm font-semibold text-white hover:bg-indigo-700 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600">Choose Team</a>
</article>

About these Tailwind Card Hover Effects

Clip inside, move inside

Zoom or slide content inside a wrapper with overflow-hidden so the card's outline never changes size.

Never hide content from touch users

Phones have no hover. The arbitrary variant [@media(hover:none)]: shows hover-only panels permanently on touch screens.

Height animation with grid

Animate grid-template-rows from [0fr] to [1fr] to expand content to its natural height, which max-height tricks only approximate.

focus-within for keyboards

When a hover panel contains a button or link, add group-focus-within: so tabbing into it reveals the panel too.

Frequently asked questions

Which demo needs JavaScript?

Only the spotlight, which tracks the pointer position.

Can I use real images?

Yes. Swap the gradient placeholders for img elements with object-cover.

Is there a CSS version?

Yes, see the CSS card hover effects collection.