
Column shutter
Transitions
The transition between two screens of a mobile app, inside a phone on a dark page with two glows: the home of an app for booking stays, with real photos of the places, and its search screen. The search bar is the shared element: tapped, it gives under the finger, then rises to the top and narrows into the search field on a spring that passes the mark by a pixel, while the home sinks back a little under frosted glass, Cancel slides in from the side, the recent searches arrive one after the other and the keyboard comes up. Typing, every key pops up over the finger and the places are filtered letter by letter; once a place is chosen, the field flies back home carrying it, with a thin ring of the accent colour.
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>
<!--
"Search bar 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 search bar to the search screen</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>
<span class="glow glow--warm" data-glow aria-hidden="true"></span>
<span class="glow glow--cool" data-glow aria-hidden="true"></span>
<!-- a phone with the home of Nookbay, an app for stays. Tapping the search bar, the bar itself is the shared
element: it rises to the top and narrows into the search field, the home sinks back under frosted glass,
Cancel slides in, the recent searches arrive one after the other and the keyboard comes up. Typing filters
the places; choosing one, the field flies back home carrying it -->
<div class="holder" data-holder>
<span class="floor" aria-hidden="true"></span>
<div class="device" data-device>
<span class="device__key device__key--a" aria-hidden="true"></span>
<span class="device__key device__key--b" aria-hidden="true"></span>
<span class="device__key device__key--c" aria-hidden="true"></span>
<div class="screen" data-screen>
<!-- the home screen -->
<section class="home" data-home>
<p class="home__hello">Good evening, Mara</p>
<h1 class="home__title">Where next?</h1>
<span class="home__avatar" aria-hidden="true">MA</span>
<div class="chips" data-chips>
<span class="chip chip--on">All stays</span>
<span class="chip">Cabins</span>
<span class="chip">Coast</span>
<span class="chip">City</span>
<span class="chip">Desert</span>
</div>
<article class="stay" data-stay>
<span class="stay__photo stay__photo--castelo" aria-hidden="true"></span>
<span class="stay__rating">
<svg viewBox="0 0 12 12" aria-hidden="true"><path d="M6 1.2l1.45 2.95 3.25.47-2.35 2.3.55 3.23L6 8.62 3.1 10.15l.55-3.23-2.35-2.3 3.25-.47z"/></svg>
4.92
</span>
<span class="stay__save" aria-hidden="true">
<svg viewBox="0 0 16 16"><path d="M8 13.4S2.2 10 2.2 6.1A2.9 2.9 0 0 1 8 4.6a2.9 2.9 0 0 1 5.8 1.5C13.8 10 8 13.4 8 13.4z"/></svg>
</span>
<span class="stay__info">
<span class="stay__name">Casa Castelo</span>
<span class="stay__where">Lisbon, 3 nights</span>
<span class="stay__price">€142<small>night</small></span>
</span>
</article>
<article class="stay stay--small">
<span class="stay__photo stay__photo--fjord" aria-hidden="true"></span>
</article>
<nav class="tabs" aria-label="App sections">
<svg class="tabs__icon tabs__icon--on" viewBox="0 0 24 24" aria-hidden="true"><path d="M4 10.5L12 4l8 6.5V19a1 1 0 0 1-1 1h-4.5v-5.5h-5V20H5a1 1 0 0 1-1-1z"/></svg>
<svg class="tabs__icon" viewBox="0 0 24 24" aria-hidden="true"><circle cx="11" cy="11" r="6"/><path d="M15.5 15.5L20 20"/></svg>
<svg class="tabs__icon" viewBox="0 0 24 24" aria-hidden="true"><path d="M12 19.5S4.5 15 4.5 9.6A3.9 3.9 0 0 1 12 7.6a3.9 3.9 0 0 1 7.5 2C19.5 15 12 19.5 12 19.5z"/></svg>
<svg class="tabs__icon" viewBox="0 0 24 24" aria-hidden="true"><circle cx="12" cy="9" r="3.6"/><path d="M5 20c1.2-3.6 4-5 7-5s5.8 1.4 7 5"/></svg>
</nav>
</section>
<!-- the search screen: frosted glass over the home -->
<section class="sheet" data-sheet aria-label="Search">
<button class="cancel" type="button" data-cancel>Cancel</button>
<div class="group" data-recent>
<p class="group__label">Recent searches <span>Clear</span></p>
<ul class="rows">
<li class="row" data-row><span class="row__thumb row__thumb--kyoto"></span><span class="row__text"><b>Kyoto, Japan</b><small>Apr 3 to 9, 2 guests</small></span><svg class="row__go" viewBox="0 0 16 16" aria-hidden="true"><circle cx="8" cy="8" r="5.4"/><path d="M8 5.2V8l1.9 1.3"/></svg></li>
<li class="row" data-row><span class="row__thumb row__thumb--copen"></span><span class="row__text"><b>Copenhagen, Denmark</b><small>Any week, 2 guests</small></span><svg class="row__go" viewBox="0 0 16 16" aria-hidden="true"><circle cx="8" cy="8" r="5.4"/><path d="M8 5.2V8l1.9 1.3"/></svg></li>
<li class="row" data-row><span class="row__thumb row__thumb--porto"></span><span class="row__text"><b>Porto, Portugal</b><small>May 22 to 25, 1 guest</small></span><svg class="row__go" viewBox="0 0 16 16" aria-hidden="true"><circle cx="8" cy="8" r="5.4"/><path d="M8 5.2V8l1.9 1.3"/></svg></li>
</ul>
<p class="group__label group__label--gap">Popular this week</p>
<div class="tags">
<span class="tag">Weekend nearby</span>
<span class="tag">Under €120</span>
<span class="tag">With a pool</span>
<span class="tag">Quiet</span>
</div>
</div>
<div class="group group--results" data-results>
<p class="group__label">Places</p>
<ul class="rows" data-result-rows></ul>
</div>
<div class="keyboard" data-keyboard aria-hidden="true">
<span class="keyboard__pop" data-pop></span>
</div>
</section>
<!-- the shared element: the search bar of the home that becomes the field of the search screen -->
<div class="pill" data-pill role="button" tabindex="0" aria-label="Search stays">
<span class="pill__ring" data-ring aria-hidden="true"></span>
<svg class="pill__icon" data-pill-icon viewBox="0 0 20 20" aria-hidden="true"><circle cx="9" cy="9" r="5.6"/><path d="M13.2 13.2l3.4 3.4"/></svg>
<span class="pill__home" data-pill-home>
<b data-pill-title>Where to?</b>
<small data-pill-sub>Anywhere, any week, add guests</small>
</span>
<span class="pill__field" data-pill-field>
<span class="pill__query" data-query></span><span class="pill__caret" data-caret></span><span class="pill__hint" data-hint>Search destinations</span>
</span>
<span class="pill__filter" data-filter aria-hidden="true">
<svg viewBox="0 0 20 20"><path d="M3.5 6.5h7M14.5 6.5h2M3.5 13.5h2M9.5 13.5h7"/><circle cx="12.5" cy="6.5" r="2"/><circle cx="7.5" cy="13.5" r="2"/></svg>
</span>
</div>
<div class="status" aria-hidden="true">
<span class="status__time">9:41</span>
<span class="status__island"></span>
<svg class="status__icons" viewBox="0 0 52 12"><rect x="0" y="8" width="3" height="4" rx="1"/><rect x="5" y="6" width="3" height="6" rx="1"/><rect x="10" y="3.5" width="3" height="8.5" rx="1"/><rect x="15" y="1" width="3" height="11" rx="1"/><rect class="status__cell" x="26.5" y="1.5" width="21" height="9.5" rx="2.6"/><rect x="28.5" y="3.5" width="14" height="5.5" rx="1.4"/><rect x="48.6" y="4.4" width="1.6" height="3.6" rx=".8"/></svg>
</div>
<span class="indicator" aria-hidden="true"></span>
<span class="glare" aria-hidden="true"></span>
</div>
</div>
</div>
<p class="sr" aria-live="polite" data-live></p>
</main>
<script src="https://cdn.jsdelivr.net/npm/gsap@3.15.0/dist/gsap.min.js"></script>
<script src="script.js"></script>
</body>
</html>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.
49 values to change
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 “Search bar transition” from Animorio and fit it into my siteThe phone is 308 by 628 design pixels and shrinks as a whole with a scale worked out on resize (the --s variable): so every position inside the screen is a fixed number and the bar's two shapes are written as two objects, at home and in search.
The bar is not copied: it is the same element, on a layer above the home and above the search screen. GSAP takes its position, width, height and radius from one shape to the other with back.out, passing the mark by a pixel; inside, the home's two lines and the field with its caret cross fade, staggered.
While the bar flies, the home scales to 95% and the search screen, a layer with a blurred and saturated backdrop-filter, fades in: the home stays visible behind it, as with iOS sheets. Cancel, the recent rows and the picks come in with a 40 ms stagger, the keyboard rises on a short spring.
The keys are built by the script, with their places in pixels; pressed, a key greys and a bubble with its letter pops up above it. At every letter the places are filtered by how their name starts, the typed part goes bold and the rows refresh with a small slide.
Once a place is chosen, the same bar goes back to its home shape with the new words, swapped while they are hidden, and a ring of the accent colour closes around it. The walk on its own is a timeline that opens, types and chooses; the first touch stops it and it starts again after a few quiet seconds.
The card photos and the search thumbnails are five webp files in the demo folder, used as background-image with cover and a fallback colour underneath. On the big photo a dark shade at the top and bottom keeps the rating and the price on glass readable; Lisbon, picked in the results, reuses the card's own photo, framed on the castle.
| Name | File | Default | What it changes |
|---|---|---|---|
SPEED | script.js | 1 | 2 = the whole walk twice as fast, 0.5 = half. |
OVERSHOOT | script.js | 1.2 | How far the bar passes its mark before it settles (0 = none). |
RECEDE | script.js | 0.95 | How small the home gets behind the glass. |
TYPE_RATE | script.js | 4.5 | Letters per second when it types by itself. |
QUERY | script.js | 'Lis' | What it types by itself. |
HOLD | script.js | 1.8 | Seconds the home holds the chosen place before starting again. |
LOOP | script.js | true | Repeats the search. |
For the app or mobile site of a vacation rental platform, a hotel, a shop or a travel service: the moment the home's search bar opens into the search screen without a cut.
The same animation with adapted sizes: the phone shrinks as a whole to fit the window's height and width, and with a finger you tap the bar, type on the keys and pick the place.
Nothing moves: the bar fades out and back in already in its new shape, the search screen, the keyboard and the rows fade in and out, and the ring fades on and off.
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.
Tested on 7 November 2026
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.
Support Animorio
Animorio stays free thanks to the people who support it. If you like, buy us a coffee: it helps us make the next animations.
You asked for
We made it for you: it’s in the library, with the preview, the Playground and the code to copy.
An animation you can’t find, or a site to take apart in the journal: tell us which. We pick the next ones from here.
With your account’s email and password.
or with your email
You’re signed in as .
With your account, you can download the zip of every animation and every pack, for free.