Layout Animations

Mercury supports layout animations, allowing elements to animate their position, size, and layout changes seamlessly. To use it you must mark elements subjective to layout change with the layout attribute.

Layout IDs

By assigning the same layout value to different elements, you can create connections between them for smooth transitions.

<div use:mercury layout="uniqueId"></div>

Common error

It is a common error to add the layout directive alone. But you MUST use it with the mercury action applied to the element: use:mercury.

Wrong

<div layout="uniqueId"></div>

Right

<div use:mercury layout="uniqueId"></div>