Diorama
Markup where the component goes, CSS in your stylesheet, script before </body>. In Vue, Svelte or Angular, call initCardDiorama(el) on the mounted element instead.
Paste into Claude, ChatGPT or Cursor after filling in {{USER_STACK}}, {{USER_STYLING}} and {{USER_CONSTRAINTS}}. Neutral keeps the greys you see here; Match my project asks the model to map them onto your own colour tokens.
Install with shadcn
Needs a free account token. Get a token
npx shadcn@latest add @movin/card-dioramaAbout this component
A paper-cut landscape behind a window frame. On hover the card turns in 3D and its four paper layers (sky, far mountains, near hills, frame) pull apart in depth, each casting a shadow on the next; the cursor keeps steering the turn.
Triggers
- Hover
- 3D
- Mouse tracking
- Card
Techniques
- preserve-3d
- Perspective
- 3D transform
- clip-path
- CSS variables
Difficulty
Intermediate
Accessibility
Keyboard and screen readers
Focusable; keyboard focus opens the diorama like hover.
Reduced motion
The layers separate without animation and the cursor does not steer.
Use it in anything you build, commercial and client work included. Licence