Modus UI

Rotating Card

Web (React)

A 3D-style rotating card that responds to user hover with smooth perspective shifts.

A 3D-style rotating card that responds to user hover with smooth perspective shifts. Adds depth and interactivity to feature displays or profile cards.

Perspective

Hover over this card to see the 3D rotation effect. The card follows your mouse movement with smooth, physics-based rotation.

Interactive Element

Installation

CLI

npx @modus-ui/cli add rotating-card

Manual

  1. Copy the code from the component tab.
  2. Create a file at components/ui/rotating-card.tsx.
  3. Paste the code.

Usage

tsx
import { RotatingCard } from "@/components/ui/rotating-card";

export default function Example() {
  return (
    <RotatingCard>
      <div className="flex h-48 items-center justify-center p-8">
        <h3 className="font-serif text-xl">Feature Card</h3>
      </div>
    </RotatingCard>
  );
}

Props

PropTypeDefaultDescription
childrenReactNode-The content inside the card.
classNamestring-Additional CSS classes for the card.

Comments

  • No comments yet.