Diorama

HighlandsFour layers deep
No dependencies
Code format

Install with shadcn

Needs a free account token. Get a token

npx shadcn@latest add @movin/card-diorama

About 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

More cards

See all
You're invited
Friday, 8 pm at the Loft
EnvelopeGet code
Rare Find
No. 001 of 250
Holo FoilGet code
Negative space
Move to reveal, click to flood
Ink RevealGet code
Day & NightMove across to tilt
LenticularGet code