Manu Arora

Draggable Card

Galleries 193

About

Here is Draggable Card component

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Draggable Card to your project and fits it to your theme.

Code

How Draggable Card is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

import React from "react";
import {
  DraggableCardBody,
  DraggableCardContainer,
} from "@/components/ui/draggable-card";

export default function DraggableCardDemo() {
  const items = [
    {
      title: "Tyler Durden",
      image:
        "https://cdn.21st.dev/assets/mirror/5b/5bd047accda6563413c453afc2e6539276979d17ab03681fa8ccd9d28c718329.jpg",
      className: "absolute top-10 left-[20%] rotate-[-5deg]",
    },
    {
      title: "The Narrator",
      image:
        "https://cdn.21st.dev/assets/mirror/f8/f8794d304174ce2e25dc108cfa2e9218bafd42b19f75095cf05c097f83de17d1.jpg",
      className: "absolute top-40 left-[25%] rotate-[-7deg]",
    },
    {
      title: "Iceland",
      image:
        "https://cdn.21st.dev/assets/mirror/b9/b9758631c2f432150c01acd330ff34a3815498008365d0b7d543eae06f572e7a.jpg",
      className: "absolute top-5 left-[40%] rotate-[8deg]",
    },
    {
      title: "Japan",
      image:
        "https://cdn.21st.dev/assets/mirror/7a/7a5853bb64a6358d781cc3ab06ec45fd7be42d583aa9a164b4d457afc3adebff.jpg",
      className: "absolute top-32 left-[55%] rotate-[10deg]",
    },
    {
      title: "Norway",
      image:
        "https://cdn.21st.dev/assets/mirror/7a/7a5ea12125f49c170585725135e2d1f1a816c71a29f149feb0469396ed7cddef.jpg",
      className: "absolute top-20 right-[35%] rotate-[2deg]",
    },
    {
      title: "New Zealand",
      image:
        "https://cdn.21st.dev/assets/mirror/77/773e007a928155eaec093cec79f4cd2adb718b6fb50b5b5469623d8b1492b076.jpg",
      className: "absolute top-24 left-[45%] rotate-[-7deg]",
    },
    {
      title: "Canada",
      image:
        "https://cdn.21st.dev/assets/mirror/2b/2bd4aa1d9cb47e18df5b4a03427b142910fa911259a7ec729227c0f656e27e0c.jpg",
      className: "absolute top-8 left-[30%] rotate-[4deg]",
    },
  ];
  return (
    <DraggableCardContainer className="relative flex min-h-screen w-full items-center justify-center overflow-clip">
      <p className="absolute top-1/2 mx-auto max-w-sm -translate-y-3/4 text-center text-2xl font-black text-neutral-400 md:text-4xl dark:text-neutral-800">
        If its your first day at Fight Club, you have to fight.
      </p>
      {items.map((item) => (
        <DraggableCardBody className={item.className}>
          <img
            src={item.image}
            alt={item.title}
            className="pointer-events-none relative z-10 h-80 w-80 object-cover"
          />
          <h3 className="mt-4 text-center text-2xl font-bold text-neutral-700 dark:text-neutral-300">
            {item.title}
          </h3>
        </DraggableCardBody>
      ))}
    </DraggableCardContainer>
  );
}

Dependencies

More by Manu Arora

View all
  • Container Scroll Animation

    Container Scroll Animation

    10.2K
  • Glowing Effect

    Glowing Effect

    4.4K
  • Aurora Background

    Aurora Background

    4.4K
  • Timeline

    Timeline

    4.3K
  • Sparkles

    Sparkles

    4.1K
  • Lamp

    Lamp

    3.7K
  • Sidebar

    Sidebar

    3.6K
  • Bento Grid

    Bento Grid

    2.7K

More in Galleries

View all
  • Thumbnail image viewer

    Thumbnail image viewer

    39
  • Animated Gallery

    Animated Gallery

    1.4K
  • Editorial Collage Hero

    Editorial Collage Hero

    422
  • Elastic Gallery

    Elastic Gallery

    896
  • Hero Section 6

    Hero Section 6

    877
  • Tilted Grid Hero

    Tilted Grid Hero

    1.4K
  • Layout Grid

    Layout Grid

    821
  • 3D Carousel

    3D Carousel

    2.5K