Skip to content
animorio
IT
All components

Layers panel

Lists, HoverGSAP, CSS onlyMediumCompressed weight: Demo 6.6 KBGSAP 28 KBFreeDownload the zip

The layers panel of a design app, in a card on white: at the top the artboard with three overlapping shapes, below it their list, from the top layer to the bottom one. Picking a row gives the shape its selection frame with four handles; “Bring forward” and “Send back” swap two rows on a spring, and the shape lifts, goes over or under and settles. The eye hides a layer: the shape withdraws and the eye gets its slash.

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>
<!--
  "Layers panel" 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>Layers panel</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">
    <!-- the layers panel of a design app: three overlapping shapes and their list. The eye hides a layer, picking
         a row frames its shape, and Bring forward swaps two rows and the order of the shapes -->
    <section class="lp" data-lp aria-label="Layers">
      <div class="lp__view" aria-hidden="true">
        <div class="lp__art" data-art>
          <div class="lp__shape lp__shape--circle" data-shape="circle"><i></i></div>
          <div class="lp__shape lp__shape--square" data-shape="square"><i></i></div>
          <div class="lp__shape lp__shape--pill" data-shape="pill"><i></i></div>
          <span class="lp__sel" data-sel><i></i><i></i><i></i><i></i></span>
        </div>
      </div>
      <header class="lp__head"><strong>Layers</strong><span class="lp__clip"><span data-outinfo>Pick a layer to move it</span></span></header>
      <div class="lp__list" data-list role="listbox" aria-label="Layers, top first"></div>
      <div class="lp__acts">
        <button type="button" class="lp__btn" data-move="-1"><svg viewBox="0 0 16 16" aria-hidden="true"><path d="M8 12.500v-9M4.200 7.300 8 3.500l3.800 3.800"></path></svg>Bring forward</button>
        <button type="button" class="lp__btn" data-move="1"><svg viewBox="0 0 16 16" aria-hidden="true"><path d="M8 3.500v9M4.200 8.700 8 12.500l3.800-3.800"></path></svg>Send back</button>
      </div>
    </section>
    <span class="live" aria-live="polite" data-live></span>

    <svg class="ghost" data-ghost viewBox="0 0 24 24" aria-hidden="true"><path d="M5 3.200 19.200 11l-6.300 1.600-3.300 5.900Z"></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.

15 values to change

Works with Claude, Claude Code, ChatGPT, Cursor, VS Code, Windsurf, Codex, Gemini CLI

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 “Layers panel” 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 white, a rounded card. At the top a light grey box with three flat overlapping shapes: an orange circle at the bottom, a purple round-cornered square in the middle and a yellow pill on top. Below, “Layers” and on the right “Pick a layer to move it”; then the list: “Pill”, “Square” and “Circle”, each with its eye on the left and a small thumbnail of the shape. At the bottom two buttons, “Bring forward” and “Send back”, dimmed until something is picked. On entering the shapes drop onto one another from the bottom up. Tapping “Circle” gives the row a blue border, a blue frame with four white handles appears on the circle and on the right you read “Circle, at the bottom”. Tapping “Bring forward” moves the circle’s row up one place, swapping with the square’s, with a small bounce; on the artboard the circle grows slightly, passes over the square and settles: “Circle, in the middle”. Another tap and it goes over the pill. Tapping a row’s eye makes its shape withdraw and vanish, the row dims and a slash draws itself across the eye; another tap brings it back.

How it works

One list rules

The order is an array of three names: the first is the top layer. The rows’ positions and the shapes’ z-index both come from it.

The rows swap

Every row is put in place with a translation: swapping two names in the array is enough to make them slide into each other’s place on a spring.

Lift before passing

The shape grows for a moment, the z-index changes while it is lifted and then it comes back down: the overtaking never snaps in view.

The frame follows

The selection frame is a single element taking the position and size of the picked shape, and it hides if the layer is hidden.

Values to change

NameFileDefaultWhat it changes
ACCENTscript.js#2f6bffThe colour of the selection frame.
LIFTscript.js1.07How much the shape grows while changing place in the stack.
SPRINGscript.js1How much the rows and shapes bounce.
LOOPscript.jstrueLeft alone, the demo’s pointer picks a layer, brings it to the top and hides another.

Try them in the Playground

When to use it

In the sidebar of a design app, an image, slide or map editor, and in a page builder where sections stack. The same list with swapping rows carries the order of tracks in a mixer or of rules in a filter.

On phones

The card is at most 348 pixels wide and about 350 tall; the artboard gets shorter on short screens and the shapes keep their size. Eyes and rows are 40 pixels tall, the two buttons 44.

With reduced motion

No animated swaps and no lifting shapes: rows, order, frame and eyes change in one step. The demo’s pointer does not start.

Pitfalls

  • The three colours tell the three layers apart, but every row also has the name and the shape’s thumbnail: colour is not the only sign.
  • The eye is a button saying “Hide Circle” or “Show Circle”; the two buttons at the bottom are dimmed, not removed, when the layer is already at the top or bottom.
  • The z-index changes halfway through the move, while the shape is lifted: changing it at once would make it jump on top.
  • The selection frame’s sizes are the same ones written in the shapes’ CSS: change a shape and both need changing.
  • Every move is announced to screen readers with the layer’s name and its new place.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

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

Testing

Tested on 1 December 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 components