Drag to reorder
Reordenar arrastrando · Drag to reorder · Sortable list · Drag and drop · Lista ordinabile
You grab a list item, it lifts with a deeper shadow and moves while the others slide out of its way. On release it settles into its new slot with a small bounce.
- Era
- 2008 – today
- Use
- Mainstream
Live demo
View code
<main>
<h1>Priorità di oggi</h1>
<ul class="list">
<li><i class="g"></i><b>Rispondere ai clienti</b><em style="background:#FFC94D">Urgente</em></li>
<li><i class="g"></i><b>Bozza della newsletter</b><em style="background:#B7B2D9">Scrittura</em></li>
<li><i class="g"></i><b>Revisione del logo</b><em style="background:#7B61FF33">Design</em></li>
<li><i class="g"></i><b>Prenotare il treno</b><em style="background:#C8F2D8">Viaggio</em></li>
</ul>
</main>
<script>
const ul=document.querySelector('.list'),it=[...ul.children],H=50;let ord=it.map((_,i)=>i);
const place=()=>it.forEach((e,i)=>e.style.setProperty('--y',ord.indexOf(i)*H+'px'));place();
if(matchMedia('(prefers-reduced-motion: no-preference)').matches){
const seq=[[0,2],[3,0],[2,3],[1,0]];let k=0;
const run=()=>{const [who,to]=seq[k++%seq.length],e=it[ord[who]];e.classList.add('lift');
let p=who;const step=()=>{if(p===to){setTimeout(()=>{e.classList.remove('lift');setTimeout(run,900)},350);return}
const q=p+(to>p?1:-1);[ord[p],ord[q]]=[ord[q],ord[p]];p=q;place();setTimeout(step,420)};
setTimeout(step,450)};
setTimeout(run,800);
}
</script> body{margin:0;height:100vh;display:grid;place-items:center;background:#F1F0FB;font-family:'Plus Jakarta Sans',sans-serif;color:#26215C}
main{width:340px;max-width:92vw}
h1{font-size:20px;margin:0 0 12px}
.list{list-style:none;margin:0;padding:0;position:relative;height:200px}
li{--y:0px;position:absolute;left:0;right:0;top:0;height:42px;display:flex;align-items:center;gap:12px;padding:0 12px;background:#fff;border-radius:12px;box-shadow:0 1px 2px #26215C1a;transform:translateY(var(--y));font-size:14px}
li b{flex:1;font-weight:500}
em{font-style:normal;font-size:11px;font-weight:700;padding:3px 8px;border-radius:99px}
.g{width:10px;height:16px;background:radial-gradient(circle,#B7B2D9 1.5px,transparent 2px) 0 0/5px 5.4px;flex:none}
.lift{z-index:5;outline:2px solid #7B61FF;box-shadow:0 18px 30px -12px #26215C66}
.lift .g{background-image:radial-gradient(circle,#7B61FF 1.5px,transparent 2px)}
@media (prefers-reduced-motion:no-preference){
li{transition:transform .32s cubic-bezier(.2,0,0,1),box-shadow .25s,scale .25s}
.lift{scale:1.04;rotate:-1deg;transition:transform .42s cubic-bezier(.3,1.3,.5,1),box-shadow .25s,scale .25s,rotate .25s}
} Characteristics
- Lifted item with larger scale and shadow
- Neighbours sliding to make room
- Dotted grip handle
- Placeholder showing the drop target
- Soft settle on release
Palette
Click a swatch to copy it
Typography
Headings · Plus Jakarta Sans Drag to reorder
Body · Plus Jakarta Sans You grab a list item, it lifts with a deeper shadow and moves while the others slide out of its way. On release it settles into its new slot with a small bounce.
Motion
- Easing
cubic-bezier(0.2, 0, 0, 1) per i vicini; spring al rilascio- Typical duration
- 150–250 ms per lo spostamento dei vicini; 200–300 ms per posarsi
- Techniques
- pointer events, tecnica FLIP, SortableJS, dnd-kit, Framer Motion Reorder, attributi aria per il riordino da tastiera
Accessibility (reduced motion)
Items swap places instantly; the grabbed item is marked only by border and colour. Always provide up and down buttons.
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: Drag to reorder (Reordenar arrastrando). You grab a list item, it lifts with a deeper shadow and moves while the others slide out of its way. On release it settles into its new slot with a small bounce. Characteristics: Lifted item with larger scale and shadow, Neighbours sliding to make room, Dotted grip handle, Placeholder showing the drop target, Soft settle on release. Palette: #F1F0FB, #FFFFFF, #26215C, #7B61FF, #FFC94D, #B7B2D9. Typography: headings in Plus Jakarta Sans, body text in Plus Jakarta Sans (Google Fonts or equivalents). Mood: tactile, clean, rational. Motion: easing cubic-bezier(0.2, 0, 0, 1) per i vicini; spring al rilascio, typical duration 150–250 ms per lo spostamento dei vicini; 200–300 ms per posarsi; techniques: pointer events, tecnica FLIP, SortableJS, dnd-kit, Framer Motion Reorder, attributi aria per il riordino da tastiera. With prefers-reduced-motion: Items swap places instantly; the grabbed item is marked only by border and colour. Always provide up and down buttons. References: jQuery UI Sortable (2008), SortableJS, dnd-kit, bacheche di Trello.
Relations
Derives from
Similar to
References
- jQuery UI Sortable (2008)
- SortableJS
- dnd-kit
- bacheche di Trello