Motion Kit

Canvas

Card 3D

OGL-powered 3D card with rounded corners and mouse-tracking parallax rotation.

  • lit
  • ogl

Preview

OGL-powered 3D card with rounded corners. Move your cursor over it to rotate.
Attributes

Installation

pnpm dlx shadcn@latest add https://motion-kit-astro.vercel.app/r/card-3d.json

Usage

---
import "@/components/motion-kit/card-3d-element.ts";
---

<motion-card-3d
  image="/path/to/image.jpg"
  width="3.2"
  height="2"
  depth="0.08"
  radius="0.15"
  class="w-full h-[400px]"
/>

API Reference

Attribute Type Default
image URL of the image to display on the 3D card. string ""
width Width of the card in 3D space units. number 3.2
height Height of the card in 3D space units. number 2
depth Thickness/depth of the 3D card geometry. number 0.08
radius Corner radius for rounded corners (in 3D space units). number 0.15