Grid shuffle
Rejilla que se reordena · Grid shuffle · Filter and shuffle · Isotope layout · Griglia filtrabile animata
When you pick a filter, grid tiles move, vanish or reappear by gliding into their new positions instead of jumping. It makes change readable in portfolios, catalogues and galleries.
- Era
- 2010 – today
- Use
- Mainstream
Live demo
View code
<main>
<nav><button class="on" data-f="*">Tutti</button><button data-f="p">Poster</button><button data-f="l">Loghi</button><button data-f="w">Web</button></nav>
<div class="grid"></div>
</main>
<script>
const g=document.querySelector('.grid'),bs=[...document.querySelectorAll('nav button')];
const data=[['p','#FF6F61','Fiera'],['l','#4D9DE0','Onda'],['w','#E1BC29','Shop'],['p','#3BB273','Jazz'],['w','#202124','App'],['l','#FF6F61','Nodo'],['p','#4D9DE0','Mare'],['l','#E1BC29','Sole'],['w','#3BB273','Blog']];
const els=data.map(([c,col,t])=>{const e=document.createElement('div');e.className='tile';e.dataset.c=c;e.style.background=col;if(col==='#E1BC29')e.classList.add('lt');e.innerHTML=`<b>${t}</b><span>${{p:'poster',l:'logo',w:'web'}[c]}</span>`;g.append(e);return e});
const W=()=>(g.clientWidth-16)/3,H=62;
const apply=f=>{bs.forEach(b=>b.classList.toggle('on',b.dataset.f===f));let k=0;
const ord=f==='*'?[...els].sort(()=>Math.random()-.5):els;
ord.forEach(e=>{const ok=f==='*'||e.dataset.c===f;if(ok){e.style.setProperty('--x',(k%3)*(W()+8)+'px');e.style.setProperty('--y',Math.floor(k/3)*(H+8)+'px');e.style.transitionDelay=k*30+'ms';k++}e.classList.toggle('out',!ok)})};
bs.forEach(b=>b.onclick=()=>{auto=false;apply(b.dataset.f)});
let auto=true,i=0;apply('*');
if(matchMedia('(prefers-reduced-motion: no-preference)').matches)setInterval(()=>{if(auto)apply(['p','*','w','l','*'][i++%5])},2000);
</script> body{margin:0;height:100vh;display:grid;place-items:center;background:#F7F4EF;font-family:'Space Grotesk',sans-serif;color:#202124}
main{width:380px;max-width:92vw}
nav{display:flex;gap:6px;margin-bottom:12px;flex-wrap:wrap}
nav button{border:1.5px solid #202124;background:none;border-radius:99px;padding:5px 12px;font:500 13px 'Space Grotesk',sans-serif;cursor:pointer}
nav .on{background:#202124;color:#F7F4EF}
.grid{position:relative;height:202px}
.tile{--x:0;--y:0;position:absolute;left:0;top:0;width:calc((100% - 16px)/3);height:62px;border-radius:12px;padding:9px 11px;box-sizing:border-box;color:#fff;transform:translate(var(--x),var(--y));display:flex;flex-direction:column;justify-content:space-between}
.tile b{font-size:16px}.tile span{font-size:10px;letter-spacing:.1em;text-transform:uppercase;opacity:.85}
.tile.lt{color:#202124}
.out{opacity:0;transform:translate(var(--x),var(--y)) scale(.4);pointer-events:none}
@media (prefers-reduced-motion:no-preference){
.tile{transition:transform .55s cubic-bezier(.34,1.56,.64,1),opacity .35s}
}
@media (prefers-reduced-motion:reduce){.tile{transition:opacity .2s}} Characteristics
- Tiles gliding from old to new positions
- Excluded items shrinking and fading out
- Pill filters with a clear active state
- Staggered delays between tiles
- FLIP technique for animating layout
Palette
Click a swatch to copy it
Typography
Headings · Space Grotesk Grid shuffle
Body · Space Grotesk When you pick a filter, grid tiles move, vanish or reappear by gliding into their new positions instead of jumping. It makes change readable in portfolios, catalogues and galleries.
Motion
- Easing
cubic-bezier(0.34, 1.56, 0.64, 1) o spring- Typical duration
- 400–600 ms, ritardo a cascata 20–40 ms
- Techniques
- tecnica FLIP, Isotope.js, MixItUp, Framer Motion layout, View Transitions API, Shuffle.js
Accessibility (reduced motion)
The grid updates instantly with a short fade, without tiles moving.
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: Grid shuffle (Rejilla que se reordena). When you pick a filter, grid tiles move, vanish or reappear by gliding into their new positions instead of jumping. It makes change readable in portfolios, catalogues and galleries. Characteristics: Tiles gliding from old to new positions, Excluded items shrinking and fading out, Pill filters with a clear active state, Staggered delays between tiles, FLIP technique for animating layout. Palette: #F7F4EF, #202124, #FF6F61, #4D9DE0, #E1BC29, #3BB273. Typography: headings in Space Grotesk, body text in Space Grotesk (Google Fonts or equivalents). Mood: playful, rational, energetic. Motion: easing cubic-bezier(0.34, 1.56, 0.64, 1) o spring, typical duration 400–600 ms, ritardo a cascata 20–40 ms; techniques: tecnica FLIP, Isotope.js, MixItUp, Framer Motion layout, View Transitions API, Shuffle.js. With prefers-reduced-motion: The grid updates instantly with a short fade, without tiles moving. References: Isotope.js (2010), MixItUp, Shuffle.js, portfolio filtrabili delle agenzie.
Relations
Derives from
Similar to
References
- Isotope.js (2010)
- MixItUp
- Shuffle.js
- portfolio filtrabili delle agenzie