Skip to content
animorio
IT
Back to the library

Team directory search

Hover, TransitionsGSAP, CSS onlyMediumCompressed weight: Demo 6.4 KBGSAP 28 KBFreeDownload the zip

A company’s people directory: a search field, the departments as pills and the list. As you type, the rows that do not match fold shut one after the other, the letters found are highlighted in the name or the role and the count rolls. Pick a department and a black marker slides onto its pill on a spring. Hover a person and the two buttons to write to them come in from the right.

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>
<!--
  "Team directory 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>Team directory search</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">
    <!-- a team directory: the list narrows as you type, the letters found light up, the department pills
         filter with a sliding marker and each person's actions slide in on hover -->
    <section class="td" data-td aria-label="Team directory">
      <div class="td__search">
        <svg viewBox="0 0 18 18" aria-hidden="true"><circle cx="8" cy="8" r="5"></circle><path d="M12 12l3.500 3.500"></path></svg>
        <input id="td-q" data-q type="search" placeholder="Search people or roles" autocomplete="off" spellcheck="false" aria-label="Search people or roles">
        <span class="td__count"><b data-count></b></span>
      </div>
      <div class="td__chips" data-chips role="radiogroup" aria-label="Department">
        <span class="td__marker" data-marker aria-hidden="true"></span>
      </div>
      <ul class="td__list" data-list></ul>
      <p class="td__none" data-none aria-hidden="true"></p>
      <span class="td__say" data-say aria-live="polite"></span>
    </section>

    <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.

10 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 “Team directory 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 pale grey ground with a blue glow at the top, a white card. At the top the field “Search people or roles” with the magnifier and, on the right, “5 people”; below, four pills (All, Design, Engineering, Operations) with a black marker on the first; then five rows, each with a tinted disc with initials, the name and the role. Type “mar” and the field takes a blue edge, three rows slip left and fold shut one after the other, Mara Lind and Marco Bianchi remain with “Mar” highlighted in pale blue, and the count rolls to “2 people”. Delete and the rows open again. Tap “Design” and the black marker slides onto the pill, widening with a small bounce, and the two designers remain. With the pointer on a row it takes a grey ground and two discs come in from the right, the envelope and the speech bubble; pressed, they give and bounce. If nothing matches, “No one matches” appears with what was typed.

How it works

The filter

At every key each person is checked for a match (name or role, and department); only the rows that change state are animated, height from 45 to 0 with a delay that grows row by row.

The letters found

The name is rewritten in three pieces: before, the part found inside a mark, after. With text nodes, never innerHTML.

The department marker

A single black element given the x and the width of the chosen pill (offsetLeft and offsetWidth) on an elastic.

The actions

With a mouse the two buttons wait ten pixels to the right, transparent; on hover they come in staggered. Without hover they are always visible.

Values to change

NameFileDefaultWhat it changes
ACCENTscript.js#4f6bffThe colour of the active field and of the letters found.
FILTER_TIMEscript.js0.35How many seconds a row takes to fold or open when the search changes.
STAGGERscript.js0.03How many seconds between one row and the next.
SPRINGscript.js1How much the black department marker bounces as it moves: 0.3 = a little, 2 = a lot.
LOOPscript.jstrueLeft alone, the demo’s pointer searches a name, picks a department and hovers a person.

Try them in the Playground

When to use it

On a company intranet, on the team page of a work tool, in an HR app; and for any list to filter as you type: customers, products, documents.

On phones

It is made for the phone: the card is 318 pixels wide at most, the list has a fixed height so the field does not move as you type, and without hover each row’s two buttons stay visible.

With reduced motion

Rows appear and disappear at once, the department marker jumps onto the pill, the count changes without rolling and the buttons are always visible. The demo does not move by itself.

Pitfalls

  • People, roles and departments are made up. With hundreds of people the list should be virtualised and the search done by the server, with a short delay after the last key.
  • Folded rows have aria-hidden and their buttons leave the tab order, or the keyboard walks into rows that cannot be seen.
  • The departments are a radiogroup: arrows change the choice and move focus, Tab enters once only.
  • Row height is animated in pixels with a fixed number: if the row changes size the constant must change too.
  • The department marker is measured again on resize and once the fonts have loaded, because the pills change width.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

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

Testing

Tested on 22 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 animations