Motion Library ‹ Free tools

All / Exit

Collapse out of the layout

Items shrink to zero height so the list closes the gap smoothly. Uses grid rows 1fr to 0fr, no height guessing.

CSSJavaScriptIntermediate
Live demo Open full screen

Good for

Removing rows from lists, tables, carts and to-do items without the rest jumping up.

Watch out for

You cannot animate height auto. The grid-template-rows 1fr to 0fr trick works for any content height.

Accessibility

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