← Library

Essay

How I Use Shared Layout Animations

Jakub Krehel

Shared layout animations, and where they earn their place.

Motion

Summary

A layoutId is all Motion needs to animate an element between two completely different places in the tree. Jakub shows a tab switcher where each state renders its own circle in its own position, and the shared id is what makes them read as one object moving. Nothing is manipulated directly, which is the part that takes a moment to get used to. Under the hood it uses FLIP, measuring first and last positions and inverting the difference. The piece covers where the technique earns its place and how to structure the markup so it behaves.

View full writing
Read the full essay on jakub.kr
Source ↗Jakub Krehel ↗

Goes well with

  • emil-design-eng

    The design-engineering house style behind Sonner and Vaul.

    Emil KowalskiMotionCraft

    Emil's main skill. Mostly animation, with the UI-polish and component judgement that surrounds it: what to build, how far to push it, and when to stop.

    npx skills add https://github.com/emilkowalski/skills

  • animate

    Builds an animation from scratch, decisions in the order that matters.

    Emil KowalskiMotion

    Should it animate at all, what purpose, which tool, which properties, which curve and duration, how it interrupts, how it exits. Then writes the implementation.

    npx skills add https://github.com/emilkowalski/skills --skill animate

  • review-animations

    Reviews your motion strictly, against Emil's rules.

    Emil KowalskiMotionReview

    A production-critical pass over animation quality, timing and consistency in a diff. Pairs with improve-animations, which does the same for a whole codebase.

    npx skills add https://github.com/emilkowalski/skills --skill review-animations

Work with us