Skip to content
animorio
IT
All components

Store nav with search

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

The nav bar of an online outdoor clothing store, in smoked glass on a near black page with two soft lights behind it, like a Dribbble shot. Its one pixel edge catches a light that follows the pointer, and under the links a glass pill goes from page to page on a precise spring, stretching a little as it runs. The magnifier opens the search in place of the links, with the results in a glass panel under the bar; adding a product flies its swatch into the bag and the badge number rolls up.

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>
<!--
  "Store nav with search" 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 store nav bar with the search that opens</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 nav bar of an online store for outdoor clothing, in smoked glass over two soft lights. Its 1px edge catches
         a light that follows the pointer (or the page you are on); a glass pill moves under the links on a spring.
         The search button opens a field in place of the links, with the results in a glass panel under the bar, and
         adding a result flies it into the bag, whose count rolls up -->
    <div class="wrap" data-wrap>
      <nav class="bar" data-bar aria-label="Store">
        <span class="bar__edge" aria-hidden="true"></span>
        <span class="bar__sheen" aria-hidden="true"></span>

        <a class="brand" href="#" aria-label="Norrow, home">
          <svg class="brand__mark" viewBox="0 0 24 24" aria-hidden="true">
            <path d="M3 18.5L9.2 7.5l3.4 6 2.2-3.6L21 18.5z"/>
          </svg>
          <span class="brand__name">Norrow</span>
        </a>

        <div class="mid" data-mid>
          <div class="links" data-links>
            <span class="pill" data-pill aria-hidden="true"><span class="pill__glass"></span></span>
            <span class="ghost" data-ghost aria-hidden="true"></span>
            <a class="link" href="#" data-link aria-current="page"><span class="link__in">Shop</span></a>
            <a class="link" href="#" data-link><span class="link__in">Gear</span></a>
            <a class="link" href="#" data-link><span class="link__in">Journal</span></a>
          </div>

          <div class="field" data-field>
            <svg class="field__icon" viewBox="0 0 20 20" aria-hidden="true"><circle cx="8.6" cy="8.6" r="5.4"/><path d="M12.6 12.6l4.2 4.2"/></svg>
            <label class="sr" for="q">Search products</label>
            <input class="field__input" id="q" data-input type="search" autocomplete="off" spellcheck="false"
                   placeholder="Search 2,400 products" role="combobox" aria-expanded="false" aria-controls="results" aria-autocomplete="list">
            <span class="field__caret" data-caret aria-hidden="true"></span>
            <kbd class="field__key" aria-hidden="true">esc</kbd>
          </div>
        </div>

        <div class="acts">
          <button class="act act--search" type="button" data-search aria-expanded="false" aria-label="Search">
            <span class="act__in">
              <svg class="act__icon act__icon--find" data-find viewBox="0 0 20 20" aria-hidden="true"><circle cx="8.6" cy="8.6" r="5.4"/><path d="M12.6 12.6l4.2 4.2"/></svg>
              <svg class="act__icon act__icon--close" data-close viewBox="0 0 20 20" aria-hidden="true"><path d="M5.5 5.5l9 9M14.5 5.5l-9 9"/></svg>
            </span>
          </button>
          <button class="act act--bag" type="button" data-bag aria-label="Bag, 2 items">
            <span class="act__in" data-bag-in>
              <svg class="act__icon" viewBox="0 0 20 20" aria-hidden="true">
                <path class="bag__body" d="M4.4 7.2h11.2l-.9 9.1a1.4 1.4 0 0 1-1.4 1.3H6.7a1.4 1.4 0 0 1-1.4-1.3z"/>
                <path class="bag__handle" data-handle d="M7.3 7.2V6a2.7 2.7 0 0 1 5.4 0v1.2"/>
              </svg>
            </span>
            <span class="badge" data-badge aria-hidden="true"><span class="badge__roll" data-roll><span class="badge__n" data-n>2</span></span></span>
          </button>
        </div>
      </nav>

      <div class="panel" data-panel id="results" role="listbox" aria-label="Products">
        <span class="panel__edge" aria-hidden="true"></span>
        <div class="panel__head"><span>Products</span><span class="panel__count" data-count></span></div>
        <span class="hilite" data-hilite aria-hidden="true"></span>
        <div class="rows" data-rows></div>
        <p class="panel__none" data-none>Nothing yet for that. Try <b>rain</b> or <b>fleece</b>.</p>
      </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>

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.

53 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 “Store nav with search” 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 near black page, with an ember light on the left and a cool one on the right behind the bar and a very fine grain over everything, a single nav bar 58 pixels tall in smoked glass: the Norrow mark, three links (Shop, Gear, Journal), the magnifier and the bag with an orange badge that says 2. Its edge is a one pixel line that catches a warm light at the top and an ember glow at the bottom, and the light slides on a soft spring towards the pointer, or, with no mouse, towards the page you are on. Under the current page sits a glass pill with a thread of light along its base: choosing another link it runs there on a precise spring, stretches a little with its speed, passes the mark by a pixel and settles, while the glass squashes slightly and comes back; hovering a link shows a fainter ghost pill under it. Pressing the magnifier the links slide left and blur one after the other, the pill shrinks away, and the search field opens from the right in their place; the magnifier turns into a cross. Under the bar a glass panel drops with the three most searched products, each with its fabric swatch, name, a line and the price. As you type the results filter with the matched letters in bright ink, the panel changes height on a spring and a light box follows the chosen result. Pressing a result’s plus the button fills with orange as a check draws itself, the swatch flies in an arc into the bag, the bag squashes and bounces, its handle jumps, the bar’s edge flares for a moment over the bag and the badge number rolls from 2 to 3. Esc or the cross close the search and the links come back. Until someone touches it, the bar goes round by itself: it changes page twice, opens the search, types rain and adds a jacket.

How it works

The glass and its edge

The bar is smoked glass with backdrop-filter over two blurred radial gradients, which give it something to blur. The edge is a layer of its own with 1 pixel of padding and a two layer mask (content-box in xor), so only the line is left; its fill has two radial gradients anchored at --lx, the warm light at the top and the ember one at the bottom.

One spring loop for everything

A single requestAnimationFrame loop moves four springs (the pill’s position and width, the result highlight, the edge light) with four sub-steps per frame and the step capped at 1/30 s; when they are all still the loop stops. The pill stretches by |v| times STRETCH and stays centred, so it looks like a drop of glass running.

The search in place of the links

Links and field share one area: the links leave with a stagger of x, opacity and blur, the field comes in with an inset clip-path that opens from the right, the magnifier turns into a cross with a back.out. The panel drops with a clip-path from the top, and when the number of results changes its height goes from the old one to the new one, with clearProps at the end.

The swatch into the bag

The swatch leaves a copy that follows a quadratic Bézier curve from the result to the bag (the control point sits above both), shrinking and rounding; on arrival the bag squashes and comes back on an elastic, the handle jumps, the edge flares over the bag and the badge number rolls with two digits taking turns.

The walk on its own

A GSAP timeline made only of calls starts from the load event: it changes page, opens the search, types QUERY letter by letter with a drawn blinking caret, picks and adds a result, closes, and at the end brings the badge back to its starting number. At the first real touch (pointerdown, key, wheel) the timeline stops.

Values to change

NameFileDefaultWhat it changes
STIFFNESSscript.js420The spring that carries the pill and the result highlight: higher is quicker.
DAMPINGscript.js29Lower lets the pill pass its link by a pixel or two before it comes back.
STRETCHscript.js0.018How much the pill stretches with its speed, like a drop of glass.
LIGHT_STIFFNESSscript.js120The softer spring of the light on the edge, which trails behind the pill.
QUERYscript.jsrainWhat the demo types into the search on its own.
TYPE_SPEEDscript.js9Letters a second while it types.
START_COUNTscript.js2How many items are in the bag at the start.
PRODUCTSscript.js6 prodottiThe catalogue the search looks through: name, line under it, price and swatch colour.
AUTOscript.jstrueThe bar goes round by itself until someone touches it.

Try them in the Playground

When to use it

For the header of an online store, a clothing brand or a catalogue: the links to the sections, the search with its suggestions close at hand and the bag that answers when you add a product. The pill and the light on the edge also work alone for the bar of a SaaS site or an app.

On phones

Below 440 pixels the store name steps aside and the mark stays, the links get tighter and the line under each result’s name goes away; the bar is as wide as the screen minus the margins. There is no hover: the edge light follows the current page and the rest works the same on touch.

With reduced motion

Nothing moves: the pill, the light and the result highlight are at once in place, links, field, panel and icons swap with a fade, the swatch does not fly and the badge number changes in place.

Pitfalls

  • At 92vw the bar spilled sideways in the phone preview, because the stage has 16 pixels of margin on each side: its width is min(100vw minus 32 pixels, 560 pixels).
  • GSAP was writing transform on the pill while the spring moved it by hand: the spring writes the container’s transform, GSAP squashes and fades only the glass inside.
  • The walk on its own started when the script was read and the poster landed on different moments: it starts from the page’s load event.
  • The input’s real caret does not show without focus, and focusing during the walk would have scrolled the page that hosts it: the demo draws its own caret, measuring the text with measureText.

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 3 November 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