Lab // Index

Total: 04

Component // Animation

01 of 04

Origin Aware Cards

Interactive card component with origin-aware animations using Framer Motion

Demo // Live

Interactive
Virat Kohli - Cricket Legend

Virat Kohli - Cricket Legend

One of cricket's greatest batsmen and India's most successful Test captain

Cristiano Ronaldo - Football Icon

Cristiano Ronaldo - Football Icon

Five-time Ballon d'Or winner and all-time leading international goalscorer

Prabhas - Pan-Indian Superstar

Prabhas - Pan-Indian Superstar

India's first pan-Indian star and Baahubali phenomenon

Install // Steps

Total: 03

Step 01

Copy and paste the following code into your project.

import { OriginAwareCards } from "@/components/craft/origin-aware-cards";

const cards = [
  {
    id: 1,
    title: "Virat Kohli - Cricket Legend",
    shortDescription: "One of cricket's greatest batsmen and India's most successful Test captain",
    longDescription: "Virat Kohli is an Indian cricket icon and former captain widely regarded as one of the greatest all-format batters of all time...",
    image: "/images/virat-card-image.jpg",
  },
  {
    id: 2,
    title: "Cristiano Ronaldo - Football Icon",
    shortDescription: "Five-time Ballon d'Or winner and all-time leading international goalscorer",
    longDescription: "Cristiano Ronaldo is a Portuguese football legend and one of the greatest players in history...",
    image: "/images/cristiano-card-image.jpg",
  },
];

export default function MyComponent() {
  return <OriginAwareCards cards={cards} />;
}

Step 02

Update the import paths to match your project setup.

Make sure the import path matches where you saved the component file in your project.

Step 03

Install Motion if you haven't already

npm install motion

Spec // Features

Total: 04
  • 01

    Origin-aware animations

    Cards expand from their exact position using layout animations

  • 02

    Simple and clean

    Minimal design with smooth transitions

  • 03

    Dark mode

    Fully styled for both light and dark themes

  • 04

    Responsive

    Works seamlessly across all device sizes

Spec // Props

Total: 01
Origin Aware Cards props
PropTypeDescription
cardsCard[]Array of card objects with id, title, shortDescription, longDescription, and image