Skip to content
animorio
IT
Back to the library

Rearrangeable home icons

Physics, HoverGSAP, CSS onlyMediumCompressed weight: Demo 9.4 KBGSAP 28 KBFreeDownload the zip

A phone home screen, in the clean style of today’s apps: press and hold an icon and the screen goes into edit mode, the icons wobble slightly and show their minus; the one you pick up lifts with its shadow, follows your finger and the others spring aside to make room; let go, it lands in its place with a bounce. Done stops them.

The code

A folder that runs on its own: index.html, style.css, script.js and the libraries from a CDN. The React and Vue tabs hold the same demo as a ready component, which switches its animations off when it leaves the page.

<!doctype html>
<!--
  "Rearrangeable home icons" from Animorio · https://animorio.com
  License: free on your own sites and your clients’ sites, paid work included.
  Not for resale, redistribution, templates or code collections · https://animorio.com/en/license/
-->
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>The home screen icons you rearrange by dragging</title>
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/mona-sans@5.3.0/wdth.css">
  <link rel="stylesheet" href="style.css">
</head>
<body>
  <main class="stage" data-stage>
    <!-- a phone home screen: press and hold an icon and the screen goes into edit mode, the icons start to wobble;
         drag one and the others make room on a spring, let go and it settles with a bounce; Done stops them -->
    <div class="phone" data-phone>
      <div class="phone__screen" data-screen aria-label="Home screen, press and hold an icon to rearrange">
        <div class="wall" aria-hidden="true"><i class="wall__a"></i><i class="wall__b"></i><i class="wall__c"></i></div>

        <div class="status" data-status>
          <span class="status__time">10:24</span>
          <span class="status__icons" aria-hidden="true">
            <svg viewBox="0 0 18 12"><path d="M1 11h2.2V8.2H1Zm4.6 0h2.2V6H5.6Zm4.6 0h2.2V3.6h-2.2Zm4.6 0H17V1h-2.2Z"></path></svg>
            <svg viewBox="0 0 16 12"><path class="s" d="M1.6 4.4a9.2 9.2 0 0 1 12.8 0M3.9 6.8a5.9 5.9 0 0 1 8.2 0M6.2 9.1a2.6 2.6 0 0 1 3.6 0"></path></svg>
            <svg viewBox="0 0 26 12"><rect class="s" x="0.8" y="0.8" width="21.4" height="10.4" rx="3"></rect><rect x="2.6" y="2.6" width="14.2" height="6.8" rx="1.6"></rect><path d="M23.6 4.2v3.6"  class="s"></path></svg>
          </span>
        </div>

        <!-- edit mode controls: they take the place of the status bar -->
        <button type="button" class="edit-add" data-add aria-label="Add a widget">
          <svg viewBox="0 0 24 24" aria-hidden="true"><path d="M12 6.5v11M6.5 12h11"></path></svg>
        </button>
        <button type="button" class="edit-done" data-done>Done</button>

        <!-- a calendar widget above the icons: it wobbles too in edit mode -->
        <div class="widget" data-widget aria-label="Dayline widget">
          <div class="widget__jig" data-widget-jig>
            <div class="widget__card">
              <p class="widget__app">Dayline</p>
              <p class="widget__day"><b>Wed</b> 28</p>
              <p class="widget__next">Design review</p>
              <p class="widget__time">3:00 to 3:45 PM</p>
              <div class="widget__line"><i data-widget-fill></i></div>
            </div>
            <span class="app__x widget__x"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M7 12h10"/></svg></span>
          </div>
        </div>

        <div class="grid" data-grid></div>
        <div class="dock" data-dock></div>
      </div>
      <div class="phone__notch" aria-hidden="true"></div>
    </div>

    <svg class="ghost" data-ghost viewBox="0 0 24 24" aria-hidden="true"><path d="M5 3.2 19.2 11l-6.3 1.6-3.3 5.9Z"></path></svg>
  </main>

  <script src="https://cdn.jsdelivr.net/npm/gsap@3.15.0/dist/gsap.min.js"></script>
  <script src="script.js"></script>
</body>
</html>

Playground

Change values, colours and text with the controls and watch the animation respond live. Or write in the code yourself. Then download the folder with your changes.

25 values to change

Or ask your AI assistant for it

With the Animorio connector, Claude Code, ChatGPT, Cursor or VS Code take it from here, guide included, and fit it into your project. Paste this request:

Take “Rearrangeable home icons” from Animorio and fit it into my site
Platform licenseFree on your sites and your clients’ sites. Want it inside a website builder, a template platform or a client dashboard? There’s a license for agencies and platforms.

What it does

On a very light grey background there is a phone with a dark frame, a pale wallpaper washed with three pastel shapes and at the top the time and the signal bars. Sixteen made-up apps sit in four rows, each a rounded square with its gradient, a soft light at the top and a white geometric glyph drawn by us: Tidewell with the waves, Cinder with the triangle, Orbita with the planet, Sunrow with the sun and the others; below, in the frosted glass dock, Call, Chat, Compass and Lens. Press an icon and it sinks and darkens slightly; held for more than half a second, the screen goes into edit mode: the time disappears and the plus and Done come in its place, every icon shows its minus with a small bounce and they all start to wobble, each at its own pace. The one in your hand stops wobbling, lifts up larger, loses its name and a shadow grows beneath it; it follows your finger with a slight lag, and when its centre passes over another place the icons in between slide forward or back on a spring, the nearest first. Let go, it flies into its place on an elastic, the shadow fades, the name comes back and it starts wobbling with the others again. Done, or a tap on the wallpaper, stops the wobble with a last settle, the minuses close and the time returns. A drawn pointer shows it all: it holds Cinder, carries it two rows down, changes its mind and brings it back, then presses Done; the first real touch stops it.

How it works

Three boxes per icon

Each app is a box that GSAP moves to its place, holding a box that grows when you pick it up and, inside that, one that wobbles. That way the wobble, the pick-up and the move don’t wipe each other out, because GSAP writes one transform per element.

The long press

On press the icon sinks to 0.92 and a delayedCall of HOLD_TIME seconds starts: if the finger lifts before, the icon springs back and it was just a tap; if it stays, the screen goes into edit mode and that same icon is picked up without lifting the finger.

The wobble

In edit mode each icon has its own endless timeline going from minus WOBBLE to plus WOBBLE degrees and back, with a period between 0.12 and 0.165 seconds, a random direction and a staggered start: so no two wobble together. On leaving, the timeline stops and the rotation goes back to zero on a short elastic.

The place under the finger

The icon in hand follows the pointer with two quickTo of FOLLOW seconds. On every move the grid place whose centre is nearest to the icon’s centre is looked up; if it changes, the icon is taken out of the list and put back at that position, and all the others go to their new place with elastic.out, with a small delay that grows with the distance.

The sizes

The phone is sized on the height and the width of the window, and everything else (frame, icons, names, dock) comes from a single unit passed to the CSS as a variable: on every resize the places are recomputed.

Values to change

NameFileDefaultWhat it changes
HOLD_TIMEscript.js0.55The seconds to hold an icon before the screen goes into edit mode.
WOBBLEscript.js1.6How much the icons wobble in edit mode, in degrees.
SPRINGscript.js0.62The spring the icons move with to make room: lower bounces more.
LIFTscript.js1.16How much the icon in hand grows.
FOLLOWscript.js0.1The lag with which the icon in hand follows the finger, in seconds.
PAUSEscript.js1.2The seconds of pause of the drawn pointer between one gesture and the next.

Try them in the Playground

When to use it

For the page of a phone app or system that wants to show how easy it is to customise, for a grid of dashboard shortcuts to arrange by hand, or to teach the gesture in a tutorial.

On phones

The same physics with a finger: the phone is sized on the height of the box, the icons and the names scale with it and the gesture works with touch, with the long press and the drag.

With reduced motion

No wobble and no springs: in edit mode only the minuses and Done appear, the icons that change place fade out and reappear in the new one, and there is no drawn pointer.

Pitfalls

  • The wobble, the pick-up and the move on the same element wipe each other out: GSAP writes a single transform, so three nested boxes are needed.
  • Picking the place from the finger’s point instead of the icon’s centre makes the neighbouring icons jump as soon as you grab it by a corner.
  • An endless wobble never lets the preview recording stop: the video has a fixed length.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

Compressed with gzip, the three demo files weigh 9.4 KB; the libraries: GSAP 28 KB.

Testing

Tested on 28 October 2026

  • Desktop: Done
  • Phone: Done
  • Reduced motion: Done
  • Safari on iPhone: To do

License

Use it in your own projects and in your clients’ projects. Do not resell it or redistribute it as is. GSAP stays under its own Standard license. Full license.

All animations