Cube Face

✓ DONE
No dependencies
Code format

Install with shadcn

Needs a free account token. Get a token

npx shadcn@latest add @movin/button-cube-face

About this component

On click, a 3D cube rotates 90 degrees on the X axis to reveal a second face with a confirmation message. Uses CSS transform-style: preserve-3d with two absolutely-positioned faces, a front face (translateZ) and a top face (rotateX + translateZ). Auto-resets after 1.8 seconds.

Triggers

  • Click
  • State change
  • 3D

Techniques

  • Perspective
  • 3D transform
  • CSS transition

Difficulty

Intermediate

Accessibility

Reduced motion

3D rotation disabled under prefers-reduced-motion; button remains functional.

Use it in anything you build, commercial and client work included. Licence

More buttons

See all
DiamondGet code
Elastic PressGet code
GlitchGet code
Gradient BorderGet code