FLIP Layout Transitions
Transizioni di layout FLIP · Transiciones de layout FLIP · Shared layout animation · Layout animation · Animazione di layout condiviso · Magic move
When a list reorders, filters or a card expands, items glide to their new place instead of jumping. The FLIP technique measures where they are before and after, then animates only the difference with transform.
- Era
- 2015 – today
- Use
- Mainstream
Live demo
View code
<main>
<header><h1>Riordina</h1><span id="lb">per colore</span></header>
<div class="grid" id="g">
<i style="background:#22D3EE">1</i><i style="background:#A78BFA">2</i><i style="background:#F472B6">3</i><i style="background:#FACC15">4</i>
<i style="background:#22D3EE">5</i><i style="background:#A78BFA">6</i><i style="background:#F472B6">7</i><i style="background:#FACC15">8</i>
</div>
</main>
<script>
if(matchMedia('(prefers-reduced-motion: no-preference)').matches){
const g=document.getElementById('g'),lb=document.getElementById('lb'),labels=['casuale','per numero','in evidenza','per colore'];let n=0;
function step(){const it=[...g.children],first=new Map(it.map(e=>[e,e.getBoundingClientRect()]));
it.forEach(e=>e.classList.remove('big'));
let order=it.slice();
if(n%4===0)order.sort(()=>Math.random()-.5);
else if(n%4===1)order.sort((a,b)=>a.textContent-b.textContent);
else if(n%4===2){order.sort((a,b)=>a.textContent-b.textContent);order[2].classList.add('big')}
else order.sort((a,b)=>a.style.background.localeCompare(b.style.background)||a.textContent-b.textContent);
order.forEach(e=>g.appendChild(e));lb.textContent=labels[n%4];n++;
order.forEach(e=>{const f=first.get(e),l=e.getBoundingClientRect(),dx=f.left-l.left,dy=f.top-l.top,sx=f.width/l.width,sy=f.height/l.height;
e.animate([{transformOrigin:'0 0',transform:`translate(${dx}px,${dy}px) scale(${sx},${sy})`},{transformOrigin:'0 0',transform:'none'}],{duration:620,easing:'cubic-bezier(.34,1.3,.5,1)'})});
}
setInterval(step,1900);
}
</script> body{margin:0;height:100vh;display:grid;place-items:center;overflow:hidden;background:#0F172A;color:#F8FAFC;font-family:Inter,sans-serif}
main{width:min(400px,92vw)}
header{display:flex;justify-content:space-between;align-items:baseline;margin-bottom:12px}
h1{margin:0;font:700 26px 'Space Grotesk',sans-serif}
header span{font-size:12px;font-weight:500;color:#22D3EE;letter-spacing:.1em;text-transform:uppercase}
.grid{display:grid;grid-template-columns:repeat(4,1fr);grid-auto-rows:64px;gap:10px;grid-auto-flow:dense}
.grid i{display:grid;place-items:center;border-radius:14px;font:700 20px 'Space Grotesk',sans-serif;font-style:normal;color:#0F172A;will-change:transform}
.grid i.big{grid-column:span 2;grid-row:span 2;font-size:40px} Characteristics
- First Last Invert Play as the recipe
- Transform and opacity only to stay at 60 fps
- Shared elements moving between views
- Reorders filters and reflowing grids
- Often spring-driven for a natural landing
Palette
Click a swatch to copy it
Typography
Headings · Space Grotesk FLIP Layout Transitions
Body · Inter When a list reorders, filters or a card expands, items glide to their new place instead of jumping. The FLIP technique measures where they are before and after, then animates only the difference with transform.
Motion
- Easing
cubic-bezier(0.2, 0, 0, 1) oppure spring (stiffness 300–500, damping 25–35)- Typical duration
- 300–600 ms
- Techniques
- getBoundingClientRect prima e dopo, Web Animations API, Framer Motion layout e layoutId, GSAP Flip plugin, auto-animate, View Transitions API
Accessibility (reduced motion)
Apply the new layout instantly with no movement, or with a short cross-fade.
Prompt for your agent
Copy and paste into your prompt to have an agent or image generator reproduce this style.
For web pages and UI
Design the web page or interface in this style: FLIP Layout Transitions (Transizioni di layout FLIP, Transiciones de layout FLIP). When a list reorders, filters or a card expands, items glide to their new place instead of jumping. The FLIP technique measures where they are before and after, then animates only the difference with transform. Characteristics: First Last Invert Play as the recipe, Transform and opacity only to stay at 60 fps, Shared elements moving between views, Reorders filters and reflowing grids, Often spring-driven for a natural landing. Palette: #0F172A, #F8FAFC, #22D3EE, #A78BFA, #F472B6, #FACC15. Typography: headings in Space Grotesk, body text in Inter (Google Fonts or equivalents). Mood: clean, rational, energetic. Motion: easing cubic-bezier(0.2, 0, 0, 1) oppure spring (stiffness 300–500, damping 25–35), typical duration 300–600 ms; techniques: getBoundingClientRect prima e dopo, Web Animations API, Framer Motion layout e layoutId, GSAP Flip plugin, auto-animate, View Transitions API. With prefers-reduced-motion: Apply the new layout instantly with no movement, or with a short cross-fade. References: Paul Lewis «FLIP Your Animations», GSAP Flip plugin, Framer Motion «layout» e «layoutId», auto-animate di FormKit.
Relations
Influenced
References
- Paul Lewis «FLIP Your Animations»
- GSAP Flip plugin
- Framer Motion «layout» e «layoutId»
- auto-animate di FormKit