Interactive entry

Swipe to dismiss

Swipe to dismiss helps confirm user action and keep the interface physical.

Active entry

Preview, parameters, and exports

Swipe to dismiss helps confirm user action and keep the interface physical.

Dragging an element off-screen to close it, like a drawer or toast

Browse categories
Preview
Swipe to dismiss
180ms
28px
0ms
soft
.motion-card {
  animation-name: motion-swipe-to-dismiss;
  animation-duration: 180ms;
  animation-timing-function: cubic-bezier(0.23, 1, 0.32, 1);
  animation-delay: 0ms;
  animation-fill-mode: both;
  will-change: transform, opacity;
  transform-origin: center;
}

@keyframes motion-swipe-to-dismiss {
  from {
    opacity: 0;
    transform: scale(0.96);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .motion-card {
    animation-name: motion-swipe-to-dismiss-reduced;
    animation-duration: 180ms;
    animation-delay: 0ms;
    transform: none;
    animation-iteration-count: 1;
  }
}

@keyframes motion-swipe-to-dismiss-reduced {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

Agent prompt

Use Swipe to dismiss for a UI fragment: Swipe to dismiss helps confirm user action and keep the interface physical. Animate transform and opacity, keep the duration at 180ms, use 28px of visual amplitude, add a 0ms delay, use soft easing (cubic-bezier(0.23, 1, 0.32, 1)), and include a reduced-motion fallback.

intent: entrancefeel: softcontext: card
Usage
  • Use it when you need to confirm user action and keep the interface physical.
  • Good for low- or medium-frequency UI changes that should stay short, clear, and interruptible.
  • Copy the prompt or CSS and hand it to an agent for implementation.
Examples
  • Preview Swipe to dismiss on a card, list item, or lightweight panel.
  • Tune duration, travel, delay, and curve until Swipe to dismiss matches the surrounding interface.
Review notes
  • Prefer transform and opacity so motion stays off layout and paint work.
  • Keep UI motion under 300ms; frequent feedback should be shorter.
  • Avoid scale(0) and UI ease-in; use a physical starting point and a strong ease-out curve.
Reduced motion

Under reduced motion, Swipe to dismiss removes travel, rotation, or looping and keeps a short fade or state comparison.