Skip to content
animorio
IT
All components

Rental search with chips

Search, Text, TransitionsGSAP, CSS onlyAdvancedCompressed weight: Demo 11 KBGSAP 28 KBFreeDownload the zip

The search field of a rental homes app, on white: type it like you’d say it, «2 bedrooms under 1500 near park», and every part that is understood gets underlined in its colour, comes off the text and becomes a chip inside the field on a spring, with its icon drawing itself. The text gets shorter, the field wraps and grows, and under it the number of homes rolls. With the x a chip folds away and the rest slides back; left alone, the sentence types itself.

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>
<!--
  "Rental search with chips" 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 rental search with the words that turn into chips</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>
    <!-- the search of a rental app: plain words like 2 bedrooms, under 1500 or near park come off the sentence and
         become chips inside the field, the count of homes rolls under it -->
    <section class="find" aria-label="Lettly home search" data-find>
      <div class="field" data-field>
        <span class="field__glow" aria-hidden="true"></span>
        <svg class="field__lens" viewBox="0 0 24 24" aria-hidden="true"><circle cx="10.5" cy="10.5" r="6"></circle><path d="m15 15 4.5 4.5"></path></svg>
        <div class="field__clip" data-clip>
          <div class="field__line" data-line>
            <span class="field__text" data-text></span><span class="field__caret" data-caret aria-hidden="true"></span><span class="field__hint" data-hint aria-hidden="true">Try “2 bedrooms under 1500 near park”</span>
          </div>
        </div>
        <input class="field__input" data-input type="text" autocomplete="off" autocapitalize="off" spellcheck="false" enterkeyhint="search" aria-label="Describe the home you want, for example 2 bedrooms under 1500 near park">
        <button class="field__clear" data-clear type="button" aria-label="Clear the search"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M8 8l8 8M16 8l-8 8"></path></svg></button>
      </div>

      <div class="meta">
        <p class="meta__count" aria-live="polite"><span class="roll" data-roll></span> <span data-word>homes for rent</span></p>
        <p class="meta__read" data-read>
          <svg viewBox="0 0 24 24" aria-hidden="true"><path d="M12 3.5c.6 3.9 2.6 5.9 6.5 6.5-3.9.6-5.9 2.6-6.5 6.5-.6-3.9-2.6-5.9-6.5-6.5 3.9-.6 5.9-2.6 6.5-6.5Z"></path><path d="M18.5 15.5c.25 1.6 1 2.35 2.5 2.5-1.5.15-2.25.9-2.5 2.5-.25-1.6-1-2.35-2.5-2.5 1.5-.15 2.25-.9 2.5-2.5Z"></path></svg>
          <span data-read-text>Type it like you’d say it</span>
        </p>
      </div>
    </section>
    <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.

20 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 “Rental search with chips” 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

A white 60 pixel field with round corners, a one pixel edge and three soft shadows; the lens on the left, the grey round button to clear it on the right. Under it, the number of homes for rent (2,418) and on the right «Type it like you’d say it» with a small drawn star. When the field listens its edge turns blue, a thin ring lights up around it and a blurred light under it. As you type, as soon as a part is finished (followed by a space, or when you stop typing) its words get underlined in the filter’s colour; then they come off: the chip grows out of the words themselves on a spring, rises a few pixels and lands, the coloured fill swells, the icon turns in and draws itself stroke by stroke, the typed words rise and fade while the clean label arrives («Under $1,500»), a glint crosses the chip and the x pops in. Bedrooms are blue with the bed, the price orange with the tag, the place green with the tree (or the waves for the sea, the train for the metro), pets pink with the paw. The field wraps and grows with a settle, the number of homes rolls digit by digit and on the right you read how many filters it understood. With the x a chip folds from the back, the others slide to close the gap and the number climbs back; Backspace on the empty field first lights the last chip, then removes it. Left alone, the sentence types itself, a drawn pointer takes the price off and then clears the field.

How it works

The real field, invisible

The real input sits over the field, transparent, and only takes the keys (on a phone too, where it opens the keyboard). What you see is a wrapping row: the chips, a span with the typed text and a drawn caret. So words can become an element of their own without touching the input.

The rules that understand the words

Four regular expressions: bedrooms («2 bedrooms», «studio»), price («under 1500», «below 2k»), place («near park», «close to the beach») and pets («pet friendly»). A part only counts when it is finished, that is followed by a space, or when typing stops for half a second; the leftmost one wins. A second filter of the same kind replaces the first.

The chip is born from the words

The understood words get wrapped in a span with a growing underline. Then it measures: the chip goes in their place as wide as they are, with the icon and the x at zero width, and from there it widens to its true size, while the fill swells with back.out, the icon draws itself with stroke-dashoffset on pathLength 1 and the typed words give way to the label. The text after it moves by itself, because it is the real width that grows.

The field that grows and the rolling number

A ResizeObserver watches the row and takes the field’s height to the new size with a small settle. The number is made of columns of digits from 0 to 9: each column slides with yPercent, always the same way, up when the results fall and down when they rise, with a delay from right to left.

States and pilot

Rest, listening with the edge and the ring, typing with a steady caret, a chip just born, a chip lit by Backspace, a chip folding away and a cleared field with the chips leaving one after the other. A GSAP timeline types the sentence, takes the price off with a drawn pointer and clears; at the first real touch it stops and starts again after seven quiet seconds.

Values to change

NameFileDefaultWhat it changes
PHRASEscript.js2 bedrooms under 1500 near parkThe sentence the autopilot types by itself.
TYPE_SPEEDscript.js0.075Seconds between letters when the pilot types.
SPRINGscript.js1.7How far the chip goes past and settles as it is born (0 crisp).
RECOGNIZEscript.js0.24Seconds the understood words stay underlined before coming off.
IDLEscript.js0.55Quiet seconds after the last letter before the last part becomes a chip too.
HOLDscript.js2.2Seconds the pilot leaves the chips still before taking one off.
BASE_HOMESscript.js2418The homes for rent with no filter.

Try them in the Playground

When to use it

In the search of a rental site, a real estate portal, a travel site or a shop: wherever people type what they want in words and the filters need to show. The rules are changed in RULES for other words (sizes, colours, dates, guests).

On phones

The same animation: the field is the screen width minus 32 pixels, the chips wrap one per line and the field grows; the text stays at 16 pixels so iPhone does not zoom the page. The chips’ x and the clear button are tapped with a finger.

With reduced motion

Nothing moves: the words become chips with a fade, already at their size, removed chips fade out, the number changes with a fade and the caret does not blink; the pilot’s pointer is hidden.

Pitfalls

  • The price with «\s*(k)?\b» swallowed the space after the number and the part never counted as finished: the k is now «(?:\s?(k))?» and the space stays out.
  • Cleaning the styles with clearProps all also wiped the inline --c variable, and the chips lost their colour and icon: only the animated properties are cleaned.
  • If typing stopped while a chip was still being born, the last part stayed as text: the end of typing is now remembered and runs as soon as the chip is done.
  • A spring on the width wrapped the chip for a moment when the row was nearly full: the width arrives without a bounce and the spring is in the scale.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

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

Testing

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