04.44 · Micro-Interactions

Card Deck Swipe

Swipe the top card left or right; the next one rises. Best for quick choices.

Drag it

Drag the top card sideways and let go (or Tab to it and use the arrow keys), or press Show me.

Try it

Change a setting, then drag a card or press Show me.

How far to swipe

How far to drag before letting go sends it.

How much it turns

As if held at the bottom edge.

Like and Nope fade in as you drag.

More optionsFewer options

Cards behind

How the waiting cards show.

Copy the prompt

Paste it into an AI assistant such as ChatGPT, Claude or Cursor to build this in your own project.

Add a swipeable card deck to [your stack of cards, such as profiles or products]. Pile the cards with the waiting ones behind the top one, showing as the settings choose. While dragged, the top card follows the finger and turns as the settings choose, as if held at its bottom edge, and Like or Nope stamps fade in when the settings include them. On release, send it off that side if it went far enough or was flicked; otherwise spring it back, and grow the next card into place. Use transforms and pointer events, let up-and-down scrolling pass through, and add Nope, Like and Undo buttons for keyboards. If the visitor has reduced motion turned on, fade cards out instead of throwing them. Match the settings listed below.

Replace the words in brackets with your own element. Your settings are added at the end.

Free and open source. If this helped, a star on GitHub helps other people find it.

Star on GitHub

What it is

The full explanation is in README.md.

Good for

  • Matching apps
  • Product pickers
  • Flashcards
  • Quick polls

Avoid on

  • Lists people compare
  • Choices that need care