LayerwiseLayerwise
  • Features
  • Pricing
  • Templates
  • Docs
DownloadDownload
FeaturesPricingTemplatesDocsAI Website BuilderVibe CodingPersonal Software
DownloadDownload
  1. Glossary
  2. /
  3. Transforms

3D flip

Also called card flip or flip card animation

A card that turns over in 3D to reveal a second face on its back, built with rotateY and backface-visibility: hidden.

import { useState } from 'react';

// Both faces share one grid cell and hide their back side.
const FACE =
  'col-start-1 row-start-1 flex min-h-44 flex-col items-center justify-center gap-2 rounded-2xl border p-6 backface-hidden transition-opacity duration-300';

export function Flashcard() {
  const [flipped, setFlipped] = useState(false);

  return (
    <button
      type='button'
      onClick={() => setFlipped(!flipped)}
      className='w-72 rounded-2xl perspective-[1000px]'
    >
      {/* With reduced motion the card stays put and the faces crossfade. */}
      <span
        className={`grid transform-3d transition-transform duration-600 ease-in-out ${flipped ? 'motion-safe:rotate-y-180' : ''}`}
      >
        {/* inert keeps the hidden face out of the button's accessible name. */}
        <span
          inert={flipped}
          className={`${FACE} bg-background ${flipped ? 'motion-reduce:opacity-0' : ''}`}
        >
          <span className='text-2xl font-semibold'>¿Cómo estás?</span>
          <span className='text-sm text-muted-foreground'>Show answer</span>
        </span>
        <span
          inert={!flipped}
          className={`${FACE} bg-muted motion-safe:rotate-y-180 ${flipped ? '' : 'motion-reduce:opacity-0'}`}
        >
          <span className='text-2xl font-semibold'>How are you?</span>
          <span className='text-sm text-muted-foreground'>Show question</span>
        </span>
      </span>
    </button>
  );
}
Build a flashcard that flips when clicked or when Enter is pressed: stack both faces in one grid cell, pre-rotate the back with rotateY(180deg), set backface-visibility: hidden on both faces and transform-style: preserve-3d on the card, and put perspective: 1000px on its wrapper. Animate rotateY over 600ms with ease-in-out, make the hidden face inert, and crossfade instead of flipping when prefers-reduced-motion is set.

Paste into Layerwise or any AI coding tool.

What is 3D flip?

A flip card stacks two faces in the same spot and turns the back one around ahead of time with rotateY(180deg). Rotating the card 180deg brings the back into view. Three pieces make it work: transform-style: preserve-3d keeps the faces in 3D space, backface-visibility: hidden hides whichever face points away, and perspective on the parent makes the near edge grow as it turns.

Use it when the two sides really are the front and back of one thing: flashcards, playing cards, a product card that turns to show specs, or a payment form that flips the card preview to the CVC field.

Around 500 to 800ms with ease-in-out reads well. Hide the face that is turned away from screen readers with inert, let keyboard users flip with a real button, and crossfade the faces instead of flipping for people who prefer reduced motion.

Often confused with

3D tilt card
A 3D tilt card leans a few degrees toward the pointer. A 3D flip turns the card all the way over to show its back.

Related terms

All terms

Perspective

A CSS property that sets how far the viewer sits from a 3D scene, so rotated elements look deep up close and flatter from far away.

Rotate

A CSS transform that turns an element around its transform origin by an angle, such as `rotate(45deg)`.

3D tilt card

A card that tips in 3D as the mouse moves over it, often with a moving glare, so it feels like a physical object in your hand.

Crossfade

A transition where the old content fades out while the new content fades in at the same spot, so the two briefly overlap.

Build it with Layerwise

Describe your app, watch it run in a live preview, and publish it with a database, storage, and sign-in built in.

DownloadDownloadRead the docs
LayerwiseLayerwise

Build full-stack web apps in minutes with AI.

Product

  • Features
  • Pricing
  • Download
  • Templates

Solutions

  • AI Website Builder
  • Vibe Coding
  • Personal Software

Resources

  • Documentation
  • Changelog
  • Blog
  • Vibe Coding Glossary
  • llms.txt
  • llms-full.txt

Company

  • About
  • Contact

Legal

  • Privacy
  • Analytics Privacy
  • Terms
  • Security
  • Abuse

© 2026 Layerwise. All rights reserved.

Entrances & exits

  • Fade in
  • Slide in
  • Scale in
  • Pop in
  • Blur in
  • Reveal animation
  • Enter and exit animations

Timing & sequencing

  • Duration
  • Delay
  • Keyframes
  • Tweening
  • Stagger
  • Orchestration
  • Fill mode
  • Stepped animation
  • Looping animation
  • Yoyo animation

Easing

  • Easing
  • Linear easing
  • Ease-in
  • Ease-out
  • Ease-in-out
  • Cubic-bezier
  • Asymmetric easing
  • Overshoot easing

Springs & physics

  • Spring animation
  • Stiffness
  • Damping
  • Mass
  • Bounce
  • Velocity
  • Momentum
  • Interruptible animation
  • Rubber-banding

Transforms

  • Translate
  • Scale
  • Rotate
  • Skew
  • 3D flip
  • Perspective
  • Transform origin
  • Origin-aware animation

State transitions

  • Crossfade
  • Morph
  • Shared element transition
  • Layout animation
  • Height auto animation
  • Direction-aware transition
  • Continuity transition
  • Page transition
  • View Transitions API

Scroll effects

  • Scroll reveal
  • Scroll-driven animation
  • Parallax scrolling
  • Scrollytelling
  • Scroll pinning
  • Horizontal scroll section
  • Scroll progress bar
  • Scroll snap
  • Smooth scrolling

Interaction feedback

  • Hover effect
  • Press feedback
  • Ripple effect
  • Shake animation
  • Hold to confirm
  • Drag gesture
  • Drag to reorder
  • Swipe to dismiss
  • Pull to refresh
  • Magnetic button
  • Custom cursor
  • 3D tilt card
  • Spotlight card

Text effects

  • Typewriter effect
  • Text scramble
  • Split text animation
  • Text morph
  • Rotating words
  • Gradient text
  • Shimmer text
  • Number ticker
  • Tabular numbers
  • Underline animation

Loops & ambient motion

  • Marquee
  • Pulse animation
  • Float animation
  • Orbit animation
  • Idle animation
  • Particle background
  • Border beam
  • Confetti
  • Animated gradient

Visual effects

  • Blur
  • Clip-path
  • Mask
  • Before/after slider
  • SVG line drawing
  • Lottie animation

Motion principles

  • Purposeful animation
  • Anticipation
  • Follow-through
  • Squash and stretch
  • Perceived performance
  • Frequency of use
  • Spatial consistency
  • Reduced motion

Animation performance

  • Frame rate (FPS)
  • Jank
  • GPU acceleration
  • will-change
  • Layout thrashing

Layout

  • Hero section
  • Above the fold
  • Sticky header
  • Sidebar
  • Bento grid
  • Card
  • Flexbox
  • CSS Grid
  • Padding vs margin
  • Responsive design
  • Container
  • Masonry layout
  • Split screen
  • Z-index
  • Overflow

Components

  • Button variants
  • Modal
  • Drawer
  • Popover
  • Tooltip
  • Dropdown menu
  • Context menu
  • Toast notification
  • Tabs
  • Segmented control
  • Accordion
  • Carousel
  • Command palette
  • Combobox
  • Toggle switch
  • Checkbox
  • Radio button
  • Date picker
  • Breadcrumb
  • Pagination
  • Infinite scroll
  • Badge
  • Avatar stack
  • Empty state
  • Skeleton screen
  • Spinner
  • Progress bar
  • Data table
  • Stepper
  • Floating label
  • Inline validation
  • Alert banner
  • Tag input

States & patterns

  • Interaction states
  • Focus ring
  • Loading state
  • Optimistic UI
  • Debounce
  • Lazy loading
  • Dark mode
  • Micro-interaction
  • Affordance
  • Undo
  • Drag and drop
  • Keyboard shortcut

Visual styles

  • Glassmorphism
  • Liquid glass
  • Neumorphism
  • Claymorphism
  • Neo-brutalism
  • Skeuomorphism
  • Flat design
  • Mesh gradient
  • Aurora background
  • Grain texture
  • Glow effect
  • Drop shadow
  • Border radius
  • Grid background
  • Typographic hierarchy
  • Accent color
  • Color contrast

Vibe coding & AI

  • Vibe coding
  • Prompt
  • Context window
  • Token
  • AI agent
  • Tool call
  • Hallucination
  • Diff
  • Live preview
  • Checkpoint
  • Git commit
  • Deploy
  • Frontend and backend
  • API
  • Database
  • Rules file
  • MCP
  • Plan mode
  • Visual edit