Apply `translateX` for the drag distance (`dx`) along with a slight `rotate` (roughly `dx / 14` degrees) so the card tilts naturally in the direction you're pushing it. As `dx` grows, fade the `opacity` down too, previewing that it's about to disappear.
At `pointerup`, decide whether to commit based on whether `|dx|` crossed a threshold (usually 30–40% of the card's width). Past it, keep flying the card off screen in the same direction; short of it, transition `transform: translateX(0)` back to rest.
If left and right carry different meanings (delete vs. done), reveal a background color or icon hint based on the sign of `dx` while dragging — otherwise users lose track of what crossing the threshold actually does.
When to use
Use it for mobile lists you triage quickly — inbox, to-dos. Pair it with an undo toast to soften accidental swipes.