Skip to content
animorio
IT
All components

Shortcut recorder

Forms, HoverGSAP, CSS onlyMediumCompressed weight: Demo 7.7 KBGSAP 28 KBFreeDownload the zip

The settings field where you choose a keyboard shortcut, in a card on black. “Record” sets it listening, with a light running round the border: the keys you press come in one by one as raised keycaps. A combination already taken is refused, the field shaking its head and naming the command that has it; a free one is saved with the keys going down in a row and a tick. “Reset” brings the original back.

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>
<!--
  "Shortcut recorder" 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>Shortcut recorder</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 shortcut recorder from an app's settings: the field listens, the keys you press come in as raised
         keycaps, a combination already taken is refused with the name of who has it, and Reset brings the default back -->
    <section class="kr" data-kr aria-label="Shortcut recorder">
      <header class="kr__head"><strong>Command menu</strong><span>Open it from anywhere</span></header>

      <div class="kr__field" data-field>
        <i class="kr__glow" data-glow aria-hidden="true"></i>
        <span class="kr__keys" data-keys aria-hidden="true"></span>
        <span class="kr__ask" data-ask aria-hidden="true">Type a shortcut</span>
        <svg class="kr__mark" data-mark viewBox="0 0 20 20" aria-hidden="true"><path class="kr__ok" pathLength="1" d="M4.500 10.400 8.300 14.200 15.700 5.900"></path><path class="kr__no" pathLength="1" d="M10 4v7.200"></path><path class="kr__no" pathLength="1" d="M10 15v.100"></path></svg>
      </div>
      <p class="kr__status"><span class="kr__clip"><span data-outstatus>Ctrl Shift P opens the command menu</span></span></p>

      <ul class="kr__others">
        <li data-other="search"><span>Quick search</span><span class="kr__mini"><kbd>Ctrl</kbd><kbd>K</kbd></span></li>
        <li data-other="sidebar"><span>Toggle sidebar</span><span class="kr__mini"><kbd>Ctrl</kbd><kbd>B</kbd></span></li>
      </ul>

      <div class="kr__acts">
        <button type="button" class="kr__btn kr__btn--main" data-record><span class="kr__clip"><span data-outrecord>Record</span></span></button>
        <button type="button" class="kr__btn kr__btn--ghost" data-reset>Reset</button>
      </div>
    </section>
    <span class="live" aria-live="polite" data-live></span>

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

23 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 “Shortcut recorder” 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 black, a dark rounded card: “Command menu” and below “Open it from anywhere”. Then a recessed field with three raised keycaps in the middle, “Ctrl”, “Shift” and “P”, and under it the line “Ctrl Shift P opens the command menu”. Further down, two rows with the other commands’ shortcuts: “Quick search” with Ctrl and K, “Toggle sidebar” with Ctrl and B. At the bottom the light button “Record” and, beside it, “Reset”. Tapping “Record” empties the field, the border lights up periwinkle with a light running round it, “Type a shortcut” appears and the button becomes “Cancel”. Pressing Ctrl brings the key in tinted and held down; with K the combination closes, but it belongs to Quick search: the field shakes, turns coral with a drawn exclamation mark, the line says “Already used by Quick search” and that row’s keys light up. A moment later the field is clean and listening again. With Ctrl, Shift and L the three keys go down one after the other and come back up with a bounce, a tick draws itself on the right and the line says “Saved”. “Reset” brings the original keys back up. Esc cancels.

How it works

Listening

While the field listens, every key press is stopped before it reaches the browser and read: which modifiers are down and which key closes the combination.

Held keys

Modifiers appear at once, pressed down and tinted, and stay while you hold them: whatever is already down is not redrawn.

The check

The finished combination is compared with the ones already in use: if it is taken the field refuses it and says whose it is, then listens again.

A key in two

Every key is two elements: the outer one comes in, the inner one goes down. That way the two animations never fight.

Values to change

NameFileDefaultWhat it changes
ACCENTscript.js#8f9dffThe colour of listening and of the confirmation.
PRESSscript.js3How many pixels a key goes down when pressed.
STAGGERscript.js0.09How many seconds pass between one key and the next.
SPRINGscript.js1How much the keys bounce.
LOOPscript.jstrueLeft alone, the demo’s pointer records a shortcut already taken, then a free one, then resets.

Try them in the Playground

When to use it

In the settings of a desktop app or a web app for people who work from the keyboard: editors, developer tools, mail clients, design apps, command launchers. The same field carries a game’s key bindings or an assistant’s voice command.

On phones

The card is at most 348 pixels wide and about 320 tall. On a touch screen there is no keyboard to listen to: “Record” plays a free combination by itself, one key after the other, so the piece still shows. The buttons are 44 pixels tall.

With reduced motion

No turning light, no shake and no bounces: the keys appear already in place, the field changes colour and the texts change in one step. The demo’s pointer does not start.

Pitfalls

  • While listening the field stops keys before the browser, but Tab on its own passes: without it, keyboard users would be trapped inside. Esc always cancels.
  • A combination without Ctrl, Alt or Cmd is refused: a single letter as a shortcut breaks typing across the whole app.
  • The refusal is not just a colour: there is the exclamation mark, the sentence naming the command and the announcement for screen readers.
  • Some combinations are kept by the system or the browser and never reach the page: in a real app they belong in the list of unavailable ones.
  • Key names are words (“Ctrl”, “Shift”) and not symbols, which not every typeface has.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

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

Testing

Tested on 1 December 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