Showcase

Larger examples that combine several features. Each one runs on the page, with the files it is made of beside it. Copy both files into your project to use one.

Resizing panel

A panel that changes size with its content. layout animates the box, and AnimatePresence with mode="popLayout" crosses one view into the next.

Card stack

Throw the top card to the side and it goes to the back. The drag reports the speed of the release, so a short quick flick counts as much as a long pull.

App grid

Drag the grid in any direction. Every icon takes its size from its distance to the centre, through a derived value.

Swipe actions

Swipe a message to the left to reveal the button behind it. dragTransition settles the message open or closed, and the rows below move up when one is deleted.

Filter grid

Pick a filter. The pictures that stay move to their new place while the others leave, and the highlight moves between the buttons with a shared layoutId.

Hold to delete

Hold the button until it fills. Let go early and it empties again. onTapStart and onTapCancel drive the fill, and the check is drawn at the end.

Tilt card

Move the pointer over the card. Two springs follow the pointer, and the tilt and the glare are both derived from them.

Scroll words

Scroll inside the box. createScroll gives the progress, and each word maps its own part of it to an opacity.