Skip to content
animorio
IT
Back to the library

Inbox row transition

TransitionsGSAP, CSS onlyAdvancedCompressed weight: Demo 12 KBGSAP 28 KBFreeDownload the zip

The inbox of a made-up mail app, Tern, as clean as today’s tools: five emails with sender, subject, grey preview and time. Click a row and the row itself becomes the open message, in one shared transition: its white sheet grows to fill the window, avatar, sender and subject fly to their place at the top, the other rows slip away above and below and the body writes itself line by line. The unread count drops by one and the star lights up; Back takes the same way home and the row lands in the list with a shadow that settles.

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>
<!--
  "Inbox row transition" 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 transition from the inbox row to the message</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="palco" data-palco>
    <!-- the inbox of a made-up mail app, Tern: a row becomes the open message in one shared transition (FLIP),
         and Back takes the same way home -->
    <section class="posta" data-posta aria-label="Tern inbox">

      <div class="lista" data-lista>
        <header class="testa" data-testa>
          <div class="testa__sx">
            <span class="marchio" aria-hidden="true">
              <svg viewBox="0 0 24 24"><path d="M3.5 13.2c3.1-.4 5.6-1.9 8.5-5.4 1.4 2.6 3.8 4.3 8.5 4.6-4.4 1.2-7.4 3.4-9.6 6.6-.9-2.6-3.6-4.6-7.4-5.8Z"/></svg>
            </span>
            <h1 class="testa__titolo">Inbox</h1>
            <span class="conta" data-conta aria-live="polite"><span class="conta__cifre" data-cifre></span><span class="conta__dopo">unread</span></span>
          </div>
          <div class="testa__dx">
            <button class="tasto-icona" type="button" aria-label="Search">
              <svg viewBox="0 0 24 24"><circle cx="10.8" cy="10.8" r="6.3"/><path d="m15.6 15.6 4.4 4.4"/></svg>
            </button>
            <button class="tasto-icona" type="button" aria-label="Compose">
              <svg viewBox="0 0 24 24"><path d="M12.5 5.5H6.8A2.3 2.3 0 0 0 4.5 7.8v9.4a2.3 2.3 0 0 0 2.3 2.3h9.4a2.3 2.3 0 0 0 2.3-2.3v-5.7"/><path d="m10.2 13.8.5-2.6 7.6-7.6a1.5 1.5 0 0 1 2.1 2.1l-7.6 7.6Z"/></svg>
            </button>
          </div>
        </header>

        <div class="righe" data-righe></div>
        <span class="selezione" data-selezione aria-hidden="true"></span>

        <footer class="tasti" data-tasti aria-hidden="true">
          <span><kbd>J</kbd><kbd>K</kbd> Move</span>
          <span><kbd>Enter</kbd> Open</span>
          <span><kbd>S</kbd> Star</span>
        </footer>
      </div>

      <!-- the surface: it starts as the row and grows into the page of the message -->
      <div class="lastra" data-lastra aria-hidden="true"></div>

      <article class="messaggio" data-messaggio aria-hidden="true">
        <div class="messaggio__barra" data-entra>
          <button class="indietro" type="button" data-indietro aria-label="Back to inbox">
            <svg viewBox="0 0 24 24"><path d="M14.5 6 8.5 12l6 6"/></svg>
            <span>Inbox</span>
            <kbd>Esc</kbd>
          </button>
          <div class="azioni">
            <button class="tasto-icona stella" type="button" data-stella aria-pressed="false" aria-label="Star">
              <svg viewBox="0 0 24 24" class="stella__icona"><path class="stella__forma" d="m12 3.9 2.4 5 5.4.7-4 3.8 1 5.4L12 16.2l-4.8 2.6 1-5.4-4-3.8 5.4-.7Z"/></svg>
              <svg viewBox="0 0 40 40" class="stella__raggi" data-raggi aria-hidden="true">
                <path d="M20 8V4M30.4 14l3.5-2M30.4 26l3.5 2M20 32v4M9.6 26l-3.5 2M9.6 14l-3.5-2"/>
              </svg>
            </button>
            <button class="tasto-icona" type="button" aria-label="Snooze">
              <svg viewBox="0 0 24 24"><circle cx="12" cy="13" r="7"/><path d="M12 9.5V13l2.4 1.6M5 4.6 3 6.6M19 4.6l2 2"/></svg>
            </button>
            <button class="tasto-icona" type="button" aria-label="Archive">
              <svg viewBox="0 0 24 24"><rect x="3.8" y="4.8" width="16.4" height="4.4" rx="1.2"/><path d="M5.4 9.2v8.6a1.6 1.6 0 0 0 1.6 1.6h10a1.6 1.6 0 0 0 1.6-1.6V9.2M10 12.8h4"/></svg>
            </button>
          </div>
        </div>

        <div class="mittente">
          <span class="avatar avatar--grande" data-m-avatar aria-hidden="true"></span>
          <div class="mittente__testo">
            <span class="mittente__nome" data-m-nome></span>
            <span class="mittente__email" data-m-email data-entra></span>
          </div>
          <span class="mittente__ora" data-m-ora data-entra></span>
        </div>

        <h2 class="oggetto" data-m-oggetto></h2>

        <div class="corpo" data-corpo></div>

        <div class="allegato" data-allegato data-entra>
          <svg viewBox="0 0 24 24" aria-hidden="true"><path d="M7 3.8h6.6l4.6 4.6v10.2a1.6 1.6 0 0 1-1.6 1.6H7a1.6 1.6 0 0 1-1.6-1.6V5.4A1.6 1.6 0 0 1 7 3.8Z"/><path d="M13.4 3.9v4.7h4.7"/></svg>
          <span class="allegato__nome" data-a-nome></span>
          <span class="allegato__peso" data-a-peso></span>
        </div>

        <div class="rispondi" data-entra>
          <span class="rispondi__campo" data-rispondi>Reply</span>
          <kbd>R</kbd>
        </div>
      </article>
    </section>

    <svg class="fantasma" data-fantasma viewBox="0 0 24 24" aria-hidden="true"><path d="M5 3.2 19.2 11l-6.3 1.6-3.3 5.9Z"/></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.

30 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 “Inbox row transition” 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 warm white background sits the window of Tern, a made-up mail app: at the top the black mark, «Inbox» and the orange pill «12 unread», below five emails in rows. Each row has a drawn avatar with initials on a soft tint, the sender, the subject in black and the preview in grey, the time on the right; unread ones are heavier. A thin orange bar marks the chosen row and slides on a spring wherever the pointer goes, and the row lightens. Click it and the row lifts with a shadow and its white sheet grows to fill the window; the avatar flies up and grows, sender and subject fly to their place and the subject becomes the headline, while the other rows slip away, those above upwards and those below downwards, the nearest first. Then come the Inbox button with its arrow, the star and the icons, the address and the long time, and the body of the message writes itself line by line, each line opening from the left; last the attachment and the reply field. Meanwhile the unread count rolls from 12 to 11. The star, when pressed, turns and lights up orange with six thin rays moving away. Back makes the trip the other way: the text goes, the sheet shrinks into the row, sender and subject return to their place, the other rows come back; the row lands dropping its last pixel, the shadow settles with a small rebound, the sender gets lighter because it is now read and a small star appears beside the time. A drawn pointer opens the first email, stars it, goes back, opens the third and goes back; it also works with a finger and the keyboard (J and K, Enter, Esc, S).

How it works

The row becomes the sheet

On click the row is measured against the window (getBoundingClientRect minus the border). A separate white sheet starts exactly there, with the row’s corners, and GSAP animates its left, top, width, height and radius up to the whole window with expo.out. The clicked row stays above the sheet, transparent, so the preview and the time fade out in place while the sheet grows.

Avatar, sender and subject in flight

The message is already laid out in place, invisible: it is a FLIP. We measure where avatar, name and subject sit in the row and in the message, and each one starts moved and shrunk (the row’s font size over the message’s, origin top left) and goes back to zero. The avatar goes from 30 to 40 pixels, and in the same flight the variable font weight goes from the row’s to the headline’s.

The other rows slip away

Rows above go up and rows below go down by FUGA pixels, further the further away they are, with a delay that grows with distance. They fade in less than half the time they slide, and the row container clips what leaves it, so they never peek out under the edge of the sheet.

The body writes itself line by line

The text of the message is split into its real lines: each word in a span, then grouped by offsetTop and put back in blocks, one line per block. Each line comes in with a fade and a clip-path inset opening from the left, staggered by SFALSA seconds. The split is redone on every resize.

The count and the star

The unread number is made of columns of digits from 0 to 9 under a faded mask: opening an unread message, each column rolls to its digit with back.out. The star turns from minus 24 degrees and grows with back.out, and a path of six rays spreads out and disappears.

The way back and the settling shadow

Back measures the row at rest again and makes the same trip the other way. When the sheet arrives, row and sheet drop their last pixel with back.out and the shadow, a CSS variable scaling offset, blur and opacity, goes through 1, 0.18, 0.4 and 0 in ASSESTA seconds; then the sender’s weight goes from unread to read.

Values to change

NameFileDefaultWhat it changes
VOLOscript.js0.7How long the flight from the row to the open message lasts, in seconds.
RITORNOscript.js0.62How long the message takes to go back into its row, in seconds.
FUGAscript.js34How many pixels the other rows slip away, above and below.
SFALSAscript.js0.06The delay between one line of text and the next as the message writes itself, in seconds.
ASSESTAscript.js0.9How long the shadow of the returning row takes to settle, in seconds.
NON_LETTEscript.js12How many unread emails the inbox counts at the start.
SOSTAscript.js2.2How long the message stays open in the automatic tour, in seconds.

Try them in the Playground

When to use it

For a mail or messaging app, a notification centre, a help desk’s ticket list, the comments of a dashboard: whenever a row in a list opens into its detail and the viewer must not lose the thread between the list and the page.

On phones

The same transition with adapted sizes: in the phone box each row goes on three lines (sender and time, subject, preview), the window is sized on the height too and the attachment and the keys line hide when space is short. A tap opens the row like a click.

With reduced motion

No flight and no movement: the list fades out and the message fades in already in place, the digits change without rolling and the star lights up without rays; Back does the same the other way.

Pitfalls

  • The preview’s ellipsis belonged to the row block, not to the span: fading the span left the three dots hanging over the open message. Now the second line is a flex and the preview draws its own ellipsis.
  • The sheet and the clicked row must share one stacking context: the list has no opacity or transform, the sheet has z-index 2 and the clicked row 3, so preview and time fade above the sheet and the other rows pass below.
  • Focusing the Back button from code showed the focus ring even on the autopilot’s click: focus moves only when the row was opened from the keyboard (a click with detail 0).
  • Rows going down peeked out under the edge of the sheet before it reached the bottom: now they fade faster than they slide and the row container clips what leaves it.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

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

Testing

Tested on 27 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