Skip to content
IndexRequest a UIAboutContact

Flip Card

A two-sided card that turns over in 3D on hover, focus or tap.

Open alone ↗

AI prompt

PROMPT: PASTE INTO YOUR AI CODING TOOL
Build a flip card, 240x150px, as a single button with aria-pressed. Inside, a 3D scene (perspective 900px) holds an inner element with transform-style preserve-3d and two absolutely positioned faces, each with backface-visibility hidden. The front shows the word "Latency" in 20px semibold with a small hint "Hover or tap"; the back (rotated 180deg around Y) shows the definition "The delay between an action and its visible response." in 13px text. On hover with a fine pointer, and on click, Enter or Space, rotate the inner element 180deg over 560ms cubic-bezier(.3,.8,.2,1). Toggle aria-pressed on click. Use :focus-visible for a 2px ring around the card. On devices without hover, only click toggles. Under prefers-reduced-motion replace rotation with a 150ms opacity cross-fade between faces.

About this pattern

Definition

A card with a front and a back face. The card rotates 180 degrees around its vertical axis to show the other side, which carries secondary information.

Purpose & UX principles

  • Fits content with a natural pair: term and meaning, product and specs, question and answer.
  • The flip is triggered by hover on pointer devices and by tap or Enter on touch and keyboard, so it never depends on hover alone.
  • Hidden faces are removed from the accessibility tree so only the visible side is read.

Interaction states

  • Front, back, hover (flip begins), focus-visible ring, pressed (tiny scale).
  • aria-pressed on the card button reports whether the back is showing.

Motion specification

  • Rotation 560ms cubic-bezier(.3,.8,.2,1) with perspective 900px.
  • Faces use backface-visibility hidden.
  • Reduced motion: the faces cross-fade in 150ms instead of rotating.

Responsive behaviour

  • The card keeps a fixed aspect ratio and scales with its container.
  • On touch, tapping toggles the flip; there is no hover state.

Code

HTML
<button class="flip" id="f" aria-pressed="false" aria-label="Latency, flip card for definition">
  <span class="inner">
    <span class="face front"><b>Latency</b><small>Hover or tap</small></span>
    <span class="face back">The delay between an action and its visible response.</span>
  </span>
</button>

Related patterns

Hover Reveal Card

↗
Hover Reveal CardCards & Containers

Tilt Card

↗
Tilt CardCards & Containers

Interactive Card

↗
Interactive CardCards & Containers