Motion Library ‹ Free tools

All / Exit

Fade out then remove

Click to dismiss. The element fades and shrinks, then is removed from the DOM only after the transition ends.

CSSJavaScriptBeginner
Live demo Open full screen

Good for

Dismissible alerts, chips, notifications and list items.

Watch out for

Never remove the node immediately, or the exit is skipped. Wait for transitionend, with a timeout as a safety net.

Accessibility

Wrap motion in @media (prefers-reduced-motion: reduce) and switch it off or shorten it for people who ask for less movement.