Skip to content
animorio
IT
All components

AI command palette

Search, Transitions, TextGSAP, CSS onlyAdvancedCompressed weight: Demo 15 KBGSAP 28 KBFreeDownload the zip

The ⌘K command palette of Loomwork, a made-up AI workspace, like a Dribbble shot: a window of dark smoked glass with light on its edge and grain, over a dark room with two soft lights. As you type the results (commands, files, people) are weighed again at every letter and slide to their new places on a spring, with FLIP; Ask AI stays on top with an iridescent light running along its edge, the highlight glides under the row chosen with the arrows and every command has its shortcut on the right, with drawn keys. Choosing Ask AI the other rows fold away, the window grows and the answer arrives word by word with a small light running just ahead of it.

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>
<!--
  "AI command palette" 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 AI command palette with the reordering results</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 room behind the glass: two soft coloured lights out of focus, the floor catching them, a fine grain -->
    <div class="room" aria-hidden="true">
      <span class="room__light room__light--a" data-light></span>
      <span class="room__light room__light--b" data-light></span>
      <span class="room__light room__light--c" data-light></span>
      <span class="room__floor"></span>
      <span class="room__grain"></span>
    </div>

    <!-- the command palette of Loomwork, a made-up AI workspace. A window of smoked glass: typing, the results
         (commands, files, people) reorder on a spring, Ask AI stays on top with an iridescent light running on its
         edge, the highlight glides under the chosen row. Choosing Ask AI, the window grows and the answer arrives
         word by word, with a light running just ahead of it -->
    <div class="frame" data-frame>
      <div class="cp" data-cp role="dialog" aria-label="Loomwork command palette">
        <span class="cp__aura" data-aura aria-hidden="true"></span>
        <span class="cp__glass" aria-hidden="true"></span>
        <span class="cp__grain" aria-hidden="true"></span>
        <span class="cp__sheen" data-sheen aria-hidden="true"></span>
        <span class="cp__rim" aria-hidden="true"></span>

        <div class="cp__field">
          <svg class="cp__lens" viewBox="0 0 16 16" aria-hidden="true"><circle cx="7" cy="7" r="4.6"/><path d="M10.4 10.4L14 14"/></svg>
          <span class="cp__input-wrap">
            <input class="cp__input" data-input type="text" autocomplete="off" spellcheck="false"
                   placeholder="Search or ask Loomwork…" aria-label="Search commands, files and people, or ask Loomwork AI"
                   role="combobox" aria-expanded="true" aria-controls="cp-list" aria-autocomplete="list">
            <span class="cp__mirror" data-mirror aria-hidden="true"></span>
            <span class="cp__caret" data-caret aria-hidden="true"></span>
          </span>
          <button class="cp__kbd" type="button" data-cmdk aria-label="Focus the palette, Command K">
            <span class="key" data-k="cmd"><svg viewBox="0 0 16 16" aria-hidden="true"><path d="M6 6V4a2 2 0 1 0-2 2h8a2 2 0 1 0-2-2v8a2 2 0 1 0 2-2H4a2 2 0 1 0 2 2V6z"/></svg></span>
            <span class="key" data-k="k">K</span>
          </button>
        </div>
        <span class="cp__rule" aria-hidden="true"></span>

        <div class="cp__body" data-body>
          <span class="cp__probe cp__probe--row" data-probe-row aria-hidden="true"></span>
          <span class="cp__probe cp__probe--pad" data-probe-pad aria-hidden="true"></span>
          <ul class="cp__list" id="cp-list" role="listbox" aria-label="Results" data-list>
            <li class="cp__hl" data-hl aria-hidden="true"><span class="cp__hl-bar"></span></li>
          </ul>

          <section class="ans" data-answer aria-live="polite" aria-label="Loomwork AI answer">
            <header class="ans__head">
              <span class="ans__who">Loomwork AI</span>
              <span class="ans__status" data-status>
                <span class="ans__think" data-think>Reading 3 docs</span>
                <span class="ans__found" data-found>3 sources</span>
              </span>
            </header>
            <p class="ans__text" data-text></p>
            <div class="ans__src" aria-label="Sources">
              <span class="chip" data-chip><svg viewBox="0 0 16 16" aria-hidden="true"><path d="M4 2.5h5.3l3.2 3.2v7.8H4z"/><path d="M9.3 2.5v3.2h3.2"/></svg>Q4 Launch Plan</span>
              <span class="chip" data-chip><svg viewBox="0 0 16 16" aria-hidden="true"><path d="M3.5 4.5h9M3.5 8h9M3.5 11.5h5.5"/></svg>Launch checklist</span>
              <span class="chip" data-chip><svg viewBox="0 0 16 16" aria-hidden="true"><rect x="2.5" y="3.5" width="11" height="10" rx="2"/><path d="M2.5 6.8h11M5.5 2v3M10.5 2v3"/></svg>Team calendar</span>
            </div>
            <div class="ans__act">
              <button class="act act--main" type="button" data-act>Draft the email</button>
              <button class="act" type="button" data-act>Open the plan</button>
            </div>
          </section>
        </div>

        <footer class="cp__foot">
          <span class="hint">
            <span class="key key--sm" data-k="up"><svg viewBox="0 0 16 16" aria-hidden="true"><path d="M8 12.5V3.8M4.6 7.2L8 3.8l3.4 3.4"/></svg></span>
            <span class="key key--sm" data-k="down"><svg viewBox="0 0 16 16" aria-hidden="true"><path d="M8 3.5v8.7M4.6 8.8L8 12.2l3.4-3.4"/></svg></span>
            <span class="hint__word">Navigate</span>
          </span>
          <span class="hint">
            <span class="key key--sm" data-k="enter"><svg viewBox="0 0 16 16" aria-hidden="true"><path d="M12.5 3.5v4.8H4.2"/><path d="M6.8 5.7L4.2 8.3l2.6 2.6"/></svg></span>
            <span class="hint__word">Select</span>
          </span>
          <span class="hint">
            <span class="key key--sm key--word" data-k="esc">esc</span>
            <span class="hint__word hint__swap"><span data-esc="close">Close</span><span data-esc="back">Back</span></span>
          </span>
          <span class="cp__brand">
            <svg viewBox="0 0 16 16" aria-hidden="true"><rect x="1.8" y="1.8" width="12.4" height="12.4" rx="3.6"/><path d="M5 11.2L11.2 5M5 7.6L7.6 5M8.4 11.2l2.8-2.8"/></svg>
            Loomwork
          </span>
        </footer>
      </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.

40 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 “AI command palette” 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

In an almost black room, with a soft violet light at the top left, a cyan one at the bottom right, a trace of pink and a very fine grain, a window of dark smoked glass rises slowly, wide with rounded corners: its edge is a hairline that catches the light at the top and goes into shadow at the bottom, and a soft reflection glides over the glass. At the top the field with the lens and the grey words Search or ask Loomwork…, and on the right the two keys ⌘ and K, drawn as real keys. Below five rows: on top Ask Loomwork AI anything, with the sparkle on a violet tile and an iridescent light, violet, cyan, pink and amber, running along its edge and tinting it faintly from inside; then Create new doc with ⌘ N on the right, the file Q4 Launch Plan, Maya Okafor with her initials avatar, Invite teammate with ⌘ I. At the bottom the arrow keys, Enter and esc with their words, and the Loomwork mark. The ⌘ K keys go down and light up, a caret appears and the palette types launch by itself: at every letter the results are weighed again, the ones that do not fit leave to the right fading, the new ones come in from the left one after another and the ones that stay slide to their new places on a spring that passes the mark by a pixel; the letters found turn white and bold, and the Ask AI row says about “launch” in a gradient. The down arrow goes down and the highlight, a light band with a violet and cyan line on its left, glides to Launch checklist, stretching a little as it travels, then to Q4 Launch Plan, then back up. Enter on Ask AI: the other rows fold away one after the other, the window grows on a spring, an iridescent halo lights up around the glass; Loomwork AI writes Reading 3 docs with a light passing through the words, then the answer arrives word by word, each word blurred and cyan as it lands and then taking its colour, with a small light and a bright caret ahead of it; dates and names are brighter. At the end 3 sources, three tags of the documents and two buttons, Draft the email and Open the plan. Then esc goes back to the list, the word is erased and the results go back to their places. Everything works by hand: typing, the arrows, Enter, Tab to ask the AI, esc, ⌘K or Ctrl K, the pointer on the rows; a chosen command shows what it did, with a tick, in place of its shortcut.

How it works

One element per row, for good

Every command, file or person has its row, created once and placed absolutely in the list. At every letter a score picks the top rows (the word found at a start counts more, then the letters in order with gaps, then hidden words like “launch owner”), and every row that stays goes from its old y to the new one: FLIP without measuring, because the position is always index times height. New ones come in from the left, staggered, the ones leaving go right and hide.

A spring as an ease

The motion is a function passed to GSAP as an ease: 1 − e^(−d·p) · cos(w·p), a damped spring that passes the mark by a pixel or two and settles, with d and w taken from the BOUNCE knob (at zero it becomes power3.out). The same spring moves the rows, the highlight, the window’s height and the tags of the answer.

The highlight that stretches

The band under the chosen row is a single element: it goes to the row’s y on the spring and meanwhile, with two keyframes, stretches vertically and narrows by a hair in proportion to the distance, then comes back. The keys at the bottom sink by a pixel and light up from inside by animating the CSS variable --lit.

The iridescent light on the edge

The Ask AI edge is a box with one pixel of padding and a content-box mask in exclude: only the frame shows. Inside spins a square with a conic-gradient, half transparent and half violet, cyan, pink and amber, rotated by GSAP with xPercent and yPercent (the CSS translate would be wiped out). A blurred copy of the same gradient inside the row tints it from within.

The answer word by word

The answer is split into words, each an inline-block span. A timeline brings them in at the WORD rhythm, pausing after full stops and commas: each word rises by 4 pixels, blurred and cyan, then takes its colour. Before each word a light (a blurred ellipse in screen with a bright caret) runs to its end, measured with offsetLeft and offsetWidth, and on a new line jumps to its start.

Going round by itself

From the load event a timeline presses ⌘ K, types the word with a fixed irregular rhythm, goes down twice, back up, presses Enter on Ask AI, waits for the answer and HOLD seconds, goes back with esc and erases. At the first real key, click or letter the loop stops and the palette stays as it is.

Values to change

NameFileDefaultWhat it changes
QUERYscript.jslaunchThe word the palette types by itself.
TYPE_SPEEDscript.js9Letters per second while it types by itself.
ROWSscript.js5How many rows the list shows, Ask AI included.
BOUNCEscript.js1How springy the rows and the highlight are: 0 no bounce, 2 lively.
WORDscript.js0.07Seconds between two words of the answer.
RINGscript.js3.4Seconds for one turn of the iridescent light around Ask AI.
HOLDscript.js2.8How many seconds the finished answer stays before going back to the list.
AUTOscript.jstrueTypes, moves and chooses by itself until someone touches it.

Try them in the Playground

When to use it

For a work app or an AI SaaS, a docs editor, a team tool, a dashboard or an admin panel: the ⌘K palette that finds commands, files and people and lets you ask the assistant, with the answer arriving as you read it.

On phones

On the phone the window takes almost the whole width and every size inside shrinks with the screen’s height; the secondary words go (Command, the brand in the AI row, the words beside the keys at the bottom, the third tag) and the shortcuts and keys stay. Tapping a row chooses it; the rest is the same.

With reduced motion

Nothing travels: the rows change places at once and appear or vanish with a fade, the highlight jumps and lights up again, the light on the edge stays still, the window takes its new height at once and the words of the answer only fade in, without the light ahead.

Pitfalls

  • The room lights were blurred blobs with filter blur that moved: every frame recomputed the blur and the glass, the browser slowed down, GSAP held back time and the poster landed on a different point of the answer every time. Now they are soft radial gradients without a filter, and the poster always lands on the finished answer.
  • The iridescent halo behind the window, seen through glass that was too clear, tinted the whole inside pink and green: the glass is more opaque and the halo fainter.
  • The K on its key sat a pixel higher than the drawn ⌘ beside it: keys with a letter have one pixel of room at the top.
  • Searching for «ricerca» the palette only came 14th: now the name says it is a search.
  • The video framing is measured at the start, with the window still closed: so the window sits in a box already as tall as the open one, anchored at the top like real palettes, and the answer is not cut.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

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

Testing

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