33 Tailwind CSS Card Hover Effects
23 / 33

All 33 in 33 Tailwind CSS Card Hover Effects

  1. 01Tailwind 3D Tilt & Parallax Card with Depth Layers
  2. 02Tailwind Glowing Gradient & Glassmorphic Border Card
  3. 03Tailwind Image Zoom Card with Slide-Up Content Reveal
  4. 04Tailwind 3D Flip Card (Front to Back) with backface-visibility
  5. 05Tailwind Sibling De-emphasis Pricing Grid with has-hover
  6. 06Tailwind Minimalist Elevation Card with Layered Dynamic Shadows
  7. 07Tailwind Elastic Lift Card with Spring Cubic-Bezier
  8. 08Tailwind Animated Conic Gradient Border Card with @property
  9. 09Tailwind Stacked Layer Reveal Card (Fanned Risograph Deck)
  10. 10Tailwind Holographic Foil Shimmer Card with mix-blend-mode
  11. 11Tailwind Curtain Reveal Card (Parting Velvet Halves)
  12. 12Tailwind Corner Peel Card with clip-path Triangles
  13. 13Tailwind Neon Sign Card with Layered Text-Shadow Glow
  14. 14Tailwind CRT Scanline Terminal Card with Sweeping Beam
  15. 15Tailwind Depth Parallax Landscape Card with Layer Multipliers
  16. 16Tailwind Cursor Spotlight Card with Masked Border Highlight
  17. 17Tailwind 3D Tilt Product Card with Specular Glare
  18. 18Tailwind Slide-Up Panel Card with Peek Header Swap
  19. 19Tailwind Credit Card Flip with Magnetic Strip & CVV
  20. 20Tailwind RGB Channel-Split Glitch Card
  21. 21Tailwind Rotating Conic Aura Card with Blurred Gradient Bloom
  22. 22Tailwind Blob-to-Rectangle Border Morph Card
  23. 23Tailwind Magnetic Float Orb Card with Pointer Attraction
  24. 24Tailwind Typewriter Reveal Card with Steps Animation & Caret
  25. 25Tailwind Magazine Overlay Slide Card (Full-Face Panel Takeover)
  26. 26Tailwind Breathing Film Grain Card with SVG Turbulence Noise
  27. 27Tailwind Frosted Glass Intensify Card with Deepening Backdrop Blur
  28. 28Tailwind Blueprint Reveal Card with Circular clip-path Wipe
  29. 29Tailwind Cursor-Anchored Shockwave Ripple Card
  30. 30Tailwind Color-Burn Ignition Card with Grayscale-to-Fire Hover
  31. 31Tailwind Prismatic Light Sweep Card with Screen Blend Bar
  32. 32Tailwind Book Cover Open Card with Hinged 3D Rotation
  33. 33Tailwind Drifting Aurora Ribbons Card with Blurred Gradient Bands
Tailwind + JSMIT licensed

Tailwind Magnetic Float Orb Card with Pointer Attraction

A glowing play-orb that leans toward the cursor as if caught in a magnetic field, over a faint tech grid. The pull is 20 lines of JS writing one transform; everything visible — grid, glow, spring reset — is utilities.

Live Demo
Plain CSSTailwind v4
Try it

Untitled UI Pro: 5,000+ React + Tailwind CSS v4 components · from $349 one-time

Untitled UI React · Affiliate link

Get Untitled UI Pro

The code

<section class="tch-23 w-full min-h-svh grid place-items-center bg-tch23-bg font-tch23-sans p-8">
  <article data-tch23="root" class="group relative w-[340px] h-[440px] rounded-[26px] overflow-hidden cursor-pointer bg-[radial-gradient(circle_at_50%_0%,#1c2540,#0a0d1a)] border border-tch23-acc/12">
    <div class="absolute inset-0 bg-[linear-gradient(rgb(120_160_255/0.06)_1px,transparent_1px),linear-gradient(90deg,rgb(120_160_255/0.06)_1px,transparent_1px)] bg-[length:28px_28px]"></div>
    <div data-tch23="orb" class="absolute top-1/2 left-1/2 z-3 grid place-items-center size-[110px] -mt-[55px] -ml-[55px] rounded-full bg-[linear-gradient(145deg,#6a8cff,#b46aff)] text-white font-bold text-[0.95rem] tracking-[0.05em] shadow-[0_0_40px_rgb(120_140_255/0.5)] will-change-transform transition-[transform,box-shadow] duration-200 ease-[cubic-bezier(0.34,1.56,0.64,1)] group-hover:shadow-[0_0_60px_rgb(140_120_255/0.7)] motion-reduce:transition-none">PLAY ▶</div>
    <div class="relative z-2 h-full p-[2.4rem] flex flex-col justify-between text-tch23-ink pointer-events-none">
      <span class="text-[0.72rem] tracking-[0.22em] uppercase text-tch23-mut">Interactive Demo</span>
      <h2 class="font-tch23-display font-bold text-[2.1rem] leading-[1.05]">Gravity<br>Synth</h2>
      <p class="text-[0.85rem] leading-[1.6] text-tch23-body">Move your cursor near the orb — it leans toward you like it's caught in your field.</p>
    </div>
  </article>
</section>
@import "tailwindcss";

@theme {
  --color-tch23-bg: #06060a;
  --color-tch23-bg: oklch(0.09 0.004 285);
  --color-tch23-ink: #e9eefc;
  --color-tch23-ink: oklch(0.94 0.01 265);
  --color-tch23-body: #93a0c4;
  --color-tch23-body: oklch(0.68 0.04 265);
  --color-tch23-mut: #6f8bd6;
  --color-tch23-mut: oklch(0.62 0.12 265);
  --color-tch23-acc: #78a0ff;
  --color-tch23-acc: oklch(0.72 0.15 265);
  --font-tch23-sans: 'Manrope', system-ui, sans-serif;
  --font-tch23-display: 'Unbounded', system-ui, sans-serif;
}

.tch-23 {
  width: 100%;
  min-height: 100svh;
}
(() => {
  const root = document.querySelector('.tch-23');
  if (!root) return;
  const card = root.querySelector('[data-tch23="root"]');
  const orb = root.querySelector('[data-tch23="orb"]');
  if (!card || !orb) return;
  if (!matchMedia('(hover: hover) and (pointer: fine)').matches) return;
  if (matchMedia('(prefers-reduced-motion: reduce)').matches) return;
  let frame = 0;
  card.addEventListener('mousemove', (e) => {
    if (frame) return;
    frame = requestAnimationFrame(() => {
      frame = 0;
      const r = card.getBoundingClientRect();
      const dx = (e.clientX - (r.left + r.width / 2)) * 0.4;
      const dy = (e.clientY - (r.top + r.height / 2)) * 0.4;
      orb.style.transform = 'translate(' + (dx) + 'px, ' + (dy) + 'px) scale(1.05)';
    });
  });
  card.addEventListener('mouseleave', () => {
    orb.style.transform = 'translate(0,0) scale(1)';
  });
})();

Setup — do this once per project

Skip this if your project already runs Tailwind v4.

1Load Tailwind
<script src="https://cdn.jsdelivr.net/npm/@tailwindcss/browser@4"></script>

Compiles in the browser — perfect for a CodePen or a quick test, not for production.

2Add the stylesheetRequiredthe @theme block is what makes the custom utilities exist
@import "tailwindcss";

@theme {
  --color-tch23-bg: #06060a;
  --color-tch23-bg: oklch(0.09 0.004 285);
  --color-tch23-ink: #e9eefc;
  --color-tch23-ink: oklch(0.94 0.01 265);
  --color-tch23-body: #93a0c4;
  --color-tch23-body: oklch(0.68 0.04 265);
  --color-tch23-mut: #6f8bd6;
  --color-tch23-mut: oklch(0.62 0.12 265);
  --color-tch23-acc: #78a0ff;
  --color-tch23-acc: oklch(0.72 0.15 265);
  --font-tch23-sans: 'Manrope', system-ui, sans-serif;
  --font-tch23-display: 'Unbounded', system-ui, sans-serif;
}

.tch-23 {
  width: 100%;
  min-height: 100svh;
}
3Fonts used by this demooptional — skip if you have your own type stack
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Unbounded:wght@500;700;900&family=Manrope:wght@400;500;700&display=swap">

What changed in the port

Which parts became utilities, which stayed CSS, and why.

  • The division of labour is the lesson: JS owns the position, CSS owns the personality. Move the spring into JS and you have re-implemented a transition badly.
  • The content layer carries pointer-events-none so the card, not the copy, is always the event target — which is why the orb never loses tracking over text.
  • UI change from the CSS original: rAF throttling and pointer/reduced-motion guards (the original attached unconditionally), and the orb's release now uses an overshoot curve rather than a plain ease-out.
Paste this into ChatGPT, Claude, Cursor, or any coding assistant. The block below is pre-framed with everything the AI needs to integrate this demo into your project — markup, styles, scoping notes, and the source URL. Hit Copy and paste straight into your chat.
Here's a working CSS demo from CodeFronts. Use it as-is or adapt to your framework. All classes are scoped under a unique prefix so the code won't collide with your existing styles. MIT licensed.
Demo: Tailwind Magnetic Float Orb Card with Pointer Attraction
Source: https://codefronts.com/motion/tailwind-css-card-hover-effects/tailwind-magnetic-float-orb-card/

A glowing play-orb that leans toward the cursor as if caught in a magnetic field, over a faint tech grid. The pull is 20 lines of JS writing one transform; everything visible &mdash; grid, glow, spring reset &mdash; is utilities.
## HTML
```html
<section class="tch-23 w-full min-h-svh grid place-items-center bg-tch23-bg font-tch23-sans p-8">
  <article data-tch23="root" class="group relative w-[340px] h-[440px] rounded-[26px] overflow-hidden cursor-pointer bg-[radial-gradient(circle_at_50%_0%,#1c2540,#0a0d1a)] border border-tch23-acc/12">
    <div class="absolute inset-0 bg-[linear-gradient(rgb(120_160_255/0.06)_1px,transparent_1px),linear-gradient(90deg,rgb(120_160_255/0.06)_1px,transparent_1px)] bg-[length:28px_28px]"></div>
    <div data-tch23="orb" class="absolute top-1/2 left-1/2 z-3 grid place-items-center size-[110px] -mt-[55px] -ml-[55px] rounded-full bg-[linear-gradient(145deg,#6a8cff,#b46aff)] text-white font-bold text-[0.95rem] tracking-[0.05em] shadow-[0_0_40px_rgb(120_140_255/0.5)] will-change-transform transition-[transform,box-shadow] duration-200 ease-[cubic-bezier(0.34,1.56,0.64,1)] group-hover:shadow-[0_0_60px_rgb(140_120_255/0.7)] motion-reduce:transition-none">PLAY ▶</div>
    <div class="relative z-2 h-full p-[2.4rem] flex flex-col justify-between text-tch23-ink pointer-events-none">
      <span class="text-[0.72rem] tracking-[0.22em] uppercase text-tch23-mut">Interactive Demo</span>
      <h2 class="font-tch23-display font-bold text-[2.1rem] leading-[1.05]">Gravity<br>Synth</h2>
      <p class="text-[0.85rem] leading-[1.6] text-tch23-body">Move your cursor near the orb — it leans toward you like it's caught in your field.</p>
    </div>
  </article>
</section>
```
## CSS
```css
@import "tailwindcss";

@theme {
  --color-tch23-bg: #06060a;
  --color-tch23-bg: oklch(0.09 0.004 285);
  --color-tch23-ink: #e9eefc;
  --color-tch23-ink: oklch(0.94 0.01 265);
  --color-tch23-body: #93a0c4;
  --color-tch23-body: oklch(0.68 0.04 265);
  --color-tch23-mut: #6f8bd6;
  --color-tch23-mut: oklch(0.62 0.12 265);
  --color-tch23-acc: #78a0ff;
  --color-tch23-acc: oklch(0.72 0.15 265);
  --font-tch23-sans: 'Manrope', system-ui, sans-serif;
  --font-tch23-display: 'Unbounded', system-ui, sans-serif;
}

.tch-23 {
  width: 100%;
  min-height: 100svh;
}
```

## JavaScript
```js
(() => {
  const root = document.querySelector('.tch-23');
  if (!root) return;
  const card = root.querySelector('[data-tch23="root"]');
  const orb = root.querySelector('[data-tch23="orb"]');
  if (!card || !orb) return;
  if (!matchMedia('(hover: hover) and (pointer: fine)').matches) return;
  if (matchMedia('(prefers-reduced-motion: reduce)').matches) return;
  let frame = 0;
  card.addEventListener('mousemove', (e) => {
    if (frame) return;
    frame = requestAnimationFrame(() => {
      frame = 0;
      const r = card.getBoundingClientRect();
      const dx = (e.clientX - (r.left + r.width / 2)) * 0.4;
      const dy = (e.clientY - (r.top + r.height / 2)) * 0.4;
      orb.style.transform = 'translate(' + (dx) + 'px, ' + (dy) + 'px) scale(1.05)';
    });
  });
  card.addEventListener('mouseleave', () => {
    orb.style.transform = 'translate(0,0) scale(1)';
  });
})();
```

How this works

Attraction is a proportion. The handler measures the pointer's distance from the card's centre and translates the orb by 40% of it. Near the centre the orb barely moves; near an edge it leans hard — which is what reads as a field rather than a follow.

The spring lives in CSS. JS only ever writes a transform. The overshoot on release comes from the orb's own transition with a 1.56 overshoot curve, so mouseleave simply clears the transform and the curve does the rest.

Reset on mouseleave, not mouseout. mouseout fires when the pointer crosses onto child elements, which makes the orb stutter mid-card. This is the single most common bug in magnetic effects.

Make it yours

  • Strength: the 0.4 multiplier. 0.15 is a hint, 0.5 is a strong pull.
  • Add a shadow that leans opposite the orb for a fake light source.
  • Swap the orb for a real button and the pattern becomes a magnetic CTA — keep the focus ring.

Gotchas — read before shipping

  • Throttle with requestAnimationFrame; a transform write per raw mousemove is wasted work.
  • Guard on (hover: hover) and (pointer: fine) and skip under reduced motion — the orb is decorative, so not attaching is a complete fallback.
  • Use mouseleave for the reset.
  • will-change-transform on the orb only. It is one element that moves every frame; the card is not.

Browser support

ChromeSafariFirefoxEdge
111+16.4+128+111+

Pointer events, transforms and spring transitions are universally supported; the floor is Tailwind v4's generated sheet.

Techniques used in this demo

Theme tokensset in @theme, used by a utility

Search CodeFronts

Loading…