# Components Card: Magnetic Card

A card that drifts toward the cursor as it nears, with a subtle pull. Use it for playful landing pages or feature tiles that reward a hovering pointer.

- Page: https://www.shadcn-ui-blocks.com/blocks/components/cards/magnetic-card
- Collection: [Components](https://www.shadcn-ui-blocks.com/blocks/components), Free tier
- Group: [Cards](https://www.shadcn-ui-blocks.com/blocks/components/cards)
- Created: 2026-06-14
- Preview image: https://www.shadcn-ui-blocks.com/blocks/components/cards/magnetic-card.png

## Install

```bash
npx shadcn@latest add @shadcn-ui-blocks/components-cards-magnetic-card
```

A free block: it installs with no account or key. Or install it by URL: `npx shadcn@latest add "https://www.shadcn-ui-blocks.com/r/components-cards-magnetic-card.json"`.

## Depends on

- npm packages: class-variance-authority, radix-ui
- shadcn/ui components: button, card
- Installs to: `@/components/blocks/components/cards/magnetic-card`

## About this block

Magnetic Card is a single card that drifts toward the cursor as the
pointer moves across it. The card contains a header with a title and
short description, a content area with a paragraph of supporting text,
and a footer row with two buttons. When the pointer enters the card,
both the card body and the footer buttons shift independently toward
the cursor, each at a slightly different rate, giving the impression
of layered depth.

The card content is fully independent copy. You can rewrite the title,
description, body text, and button labels to match any offer or action.
The footer layout places the secondary button on the left and the
primary button on the right, and either button can be removed if a
single call to action is enough.

## When to use

Reach for this block when a single featured item on a landing page
needs to feel alive without distracting from the surrounding layout.
It suits a product launch section, a featured plan callout, or the
hero area of an ecommerce storefront brand where a tactile interaction
signals care and craft. Compared to a static card or a simple hover
lift, the magnetic pull creates a moment of delight that encourages
the visitor to engage rather than scroll past.

A natural flow around it on a Components page:

**Before**

- [Hover Effect Card](https://www.shadcn-ui-blocks.com/blocks/components/cards/hover-effect-card) to
  warm visitors up with a lighter motion before the stronger magnetic
  pull
- A short heading section to introduce the featured item or offer

**After**

- [Perspective Hover Card](https://www.shadcn-ui-blocks.com/blocks/components/cards/perspective-hover-card)
  for a companion 3D effect that continues the interactive theme
- [Buttons](https://www.shadcn-ui-blocks.com/blocks/components/buttons) to build out a fuller action
  row below the card

## What you can display

One magnetic card works well as a spotlight for any single item or
action that deserves attention. A few ways to put it to use:

- **A featured product tile.** Show a product name, a one-line pitch,
  and an Add to Cart button so shoppers feel the pull before they click.
- **A plan or tier callout.** Place the plan name, its core benefit,
  and an upgrade button to make the recommended option feel premium
  and inviting.
- **A quick action prompt.** Use the title and body to describe what
  happens next and let the footer buttons confirm or cancel so the
  interaction feels intentional.

> Tip: keep the body text to two or three short sentences so the card
> stays compact and the magnetic motion remains the focal point.

## More in Components Cards

- [Border Accent Card](https://www.shadcn-ui-blocks.com/blocks/components/cards/border-accent-card)
- [Border Animation Card](https://www.shadcn-ui-blocks.com/blocks/components/cards/border-animation-card)
- [Border Gradient Animation Card](https://www.shadcn-ui-blocks.com/blocks/components/cards/border-gradient-animation-card)
- [Border Highlight Card](https://www.shadcn-ui-blocks.com/blocks/components/cards/border-highlight-card)
- [Corner Ribbon Card](https://www.shadcn-ui-blocks.com/blocks/components/cards/corner-ribbon-card)
- [Cutout Border Card](https://www.shadcn-ui-blocks.com/blocks/components/cards/cutout-border-card)
- [Dashed Border Card](https://www.shadcn-ui-blocks.com/blocks/components/cards/dashed-border-card)
- [Double Border Card](https://www.shadcn-ui-blocks.com/blocks/components/cards/double-border-card)
- [Expandable Card](https://www.shadcn-ui-blocks.com/blocks/components/cards/expandable-card)
- [Gradient Border Card](https://www.shadcn-ui-blocks.com/blocks/components/cards/gradient-border-card)
- [Hover Effect Card](https://www.shadcn-ui-blocks.com/blocks/components/cards/hover-effect-card)
- [Hover Reveal Card](https://www.shadcn-ui-blocks.com/blocks/components/cards/hover-reveal-card)
- [Icon Card](https://www.shadcn-ui-blocks.com/blocks/components/cards/icon-card)
- [Neon Border Card](https://www.shadcn-ui-blocks.com/blocks/components/cards/neon-border-card)
- [Perspective Hover Card](https://www.shadcn-ui-blocks.com/blocks/components/cards/perspective-hover-card)
- [Progress Card](https://www.shadcn-ui-blocks.com/blocks/components/cards/progress-card)
- [Pulse Border Card](https://www.shadcn-ui-blocks.com/blocks/components/cards/pulse-border-card)
- [Shimmer Effect Card](https://www.shadcn-ui-blocks.com/blocks/components/cards/shimmer-effect-card)
- [Stacked Card](https://www.shadcn-ui-blocks.com/blocks/components/cards/stacked-card)
- [Status Card](https://www.shadcn-ui-blocks.com/blocks/components/cards/status-card)
- [Tilt Effect Card](https://www.shadcn-ui-blocks.com/blocks/components/cards/tilt-effect-card)
