Skip to content
animorio
IT
All components

New password field

Forms, Text, SVGGSAP, CSS onlyMediumCompressed weight: Demo 7.0 KBGSAP 28 KBFreeDownload the zip

The field to create the password of a made-up account, Fernway, alone on white in the premium style of product shots. As you type, four small bars under the field fill on a spring one after the other and the word beside them rolls from Weak to Fair, Good and Strong, each in its colour; the four rules below (8 characters, an uppercase letter, a number, a symbol) tick themselves, drawing the check in the green circle. The eye shows the password: the lid opens and the slash wipes away. Continue wakes up with a bounce only when every rule is met and, pressed, says Password set with the check and a light crossing 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>
<!--
  "New password field" 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 new password field with the strength meter and the rules that tick themselves</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 new password field: four bars fill on a spring as the password gets stronger, the label rolls from Weak to
         Strong, and the four rules under it tick themselves one by one; the eye shows the password; Continue wakes up
         only when every rule is met -->
    <form class="pw" data-pw novalidate>
      <div class="pw__top">
        <label class="pw__label" for="pw-input">Create a password</label>
        <span class="pw__note">Fernway account</span>
      </div>

      <div class="box" data-box>
        <svg class="box__lock" viewBox="0 0 20 20" aria-hidden="true">
          <rect x="4.2" y="8.6" width="11.6" height="8.4" rx="2.4"></rect>
          <path class="box__shackle" data-shackle d="M6.9 8.6V6.4a3.1 3.1 0 0 1 6.2 0v2.2"></path>
        </svg>
        <input class="box__input" id="pw-input" data-input type="password" autocomplete="new-password" spellcheck="false"
               placeholder="At least 8 characters" aria-describedby="pw-strength pw-rules">
        <button class="eye" type="button" data-eye aria-label="Show password" aria-pressed="false">
          <svg viewBox="0 0 24 24" aria-hidden="true">
            <path class="eye__lid" d="M2.8 12s3.3-6.2 9.2-6.2 9.2 6.2 9.2 6.2-3.3 6.2-9.2 6.2S2.8 12 2.8 12Z"></path>
            <circle class="eye__pupil" data-pupil cx="12" cy="12" r="2.9"></circle>
            <path class="eye__slash" data-slash d="M4.6 4.6 19.4 19.4"></path>
          </svg>
        </button>
      </div>

      <div class="meter" id="pw-strength" aria-live="polite">
        <div class="meter__bars">
          <span class="bar"><i data-bar></i></span>
          <span class="bar"><i data-bar></i></span>
          <span class="bar"><i data-bar></i></span>
          <span class="bar"><i data-bar></i></span>
        </div>
        <span class="meter__word" data-wordbox><span class="word" data-word>&nbsp;</span></span>
      </div>

      <ul class="rules" id="pw-rules">
        <li class="rule" data-rule="len"><svg viewBox="0 0 16 16" aria-hidden="true"><circle cx="8" cy="8" r="6.4"></circle><path data-tick d="M5 8.3 7.1 10.3 11 6"></path></svg><span>8 characters or more</span></li>
        <li class="rule" data-rule="upper"><svg viewBox="0 0 16 16" aria-hidden="true"><circle cx="8" cy="8" r="6.4"></circle><path data-tick d="M5 8.3 7.1 10.3 11 6"></path></svg><span>An uppercase letter</span></li>
        <li class="rule" data-rule="num"><svg viewBox="0 0 16 16" aria-hidden="true"><circle cx="8" cy="8" r="6.4"></circle><path data-tick d="M5 8.3 7.1 10.3 11 6"></path></svg><span>A number</span></li>
        <li class="rule" data-rule="sym"><svg viewBox="0 0 16 16" aria-hidden="true"><circle cx="8" cy="8" r="6.4"></circle><path data-tick d="M5 8.3 7.1 10.3 11 6"></path></svg><span>A symbol</span></li>
      </ul>

      <button class="go" type="submit" data-go disabled>
        <span class="go__face">
          <span class="go__sweep" aria-hidden="true"></span>
          <span class="go__label" data-golabel>Continue</span>
          <span class="go__done" data-done aria-hidden="true"><svg viewBox="0 0 16 16"><path data-donepath d="M3.6 8.4 6.6 11.2 12.4 5"></path></svg>Password set</span>
        </span>
      </button>
    </form>

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

27 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 “New password field” 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 white background there is only the field to create the password: above it Create a password and on the right Fernway account, below a box with soft edges, a drawn lock on the left and the eye on the right. Under the box four grey bars and a word; further down four rules in two columns, each with an empty circle. As you type the first bar fills red with a small overshoot and a settle, and the word rises into Weak; with the second rule met the second bar fills, they all turn orange and the word rolls into Fair, then Good in light green with three bars and Strong in green with four, each time the word leaves upwards and comes in from below with a bounce; deleting brings everything back, the bars emptying from the right. Each rule met lights up: the circle fills green with a small kick, the white check draws itself and the text goes from grey to black with a tiny step. At Strong the lock and the box edge turn green and the lock’s shackle gives a small hop. The eye, touched, shows the password: the slash over the eye wipes away and the pupil opens with a bounce; touched again the slash draws itself back. Continue stays off in grey until every rule is met, then lights up in black with a bounce; pressed it squashes, the label leaves upwards and Password set comes in with the check drawing itself, the button turns green and a light crosses it. Left alone, a drawn pointer types a password that gets stronger, looks at it with the eye, hides it again and continues.

How it works

The rules and the score

Four tests with regular expressions (length, uppercase, number, symbol): the level is the number of tests passed, from Weak with one to Strong with all four. Each rule remembers whether it was met, so the check draws or wipes only when it changes.

The bars

Four grey bars with a fill inside scaled horizontally from 0 to 1 with back.out: going up they fill one after the other with a small delay and all take the level’s colour; going down they empty from the right with power2.in.

The word

The word sits in a one-line window with hidden overflow: it leaves upwards and comes back from below when the level rises, the other way when it drops, with a bounce; the colour is read from the CSS variables.

The eye and Continue

The eye switches the input type between password and text, wipes the slash with stroke-dashoffset and opens the pupil with back.out. Continue is disabled until the level is Strong; pressed, the label leaves, Password set comes in and the check draws itself.

Values to change

NameFileDefaultWhat it changes
MIN_LENGTHscript.js8How many characters the first rule asks for.
PASSWORDscript.jsHarbor42!The password the autopilot types, getting stronger.
TYPE_SPEEDscript.js0.16How many seconds per letter when the autopilot types.
BAR_SPRINGscript.js1.6How much the bars overshoot when they fill.
BAR_STAGGERscript.js0.07How many seconds between one bar and the next.
TICK_TIMEscript.js0.32How many seconds a rule’s check takes to draw.
SHOW_WHILE_TYPINGscript.jstrueWhether the autopilot opens the eye halfway to show the password.

Try them in the Playground

When to use it

In the sign-up of an app or a service, in changing the password in the account settings, in the reset after a forgotten password: wherever a new password is asked for and it pays to say what is missing while typing, instead of an error after pressing Continue.

On phones

The box narrows to the screen width minus thirty-two pixels, the rules stay in two columns; the field text is sixteen pixels so iOS does not zoom the page on tap, and the eye has a thirty-eight pixel tap area.

With reduced motion

No springs or bounces: the bars fill at once, the word changes with a fade, the checks and Password set appear already drawn. The drawn pointer is not shown, the demo still loops.

Pitfalls

  • The bar colour is read from the CSS variables with getComputedStyle, so changing the colours in :root also changes what GSAP animates.
  • The bars have hidden overflow for the rounded ends of the fill: there is no shadow inside, so nothing gets cut straight.
  • A rule ticks or wipes only when its state changes: redrawing the check at every letter would make it shake.
  • Switching the input type from password to text does not move the caret, but the spacing changes: the hidden password has wider letters, the visible text normal ones.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

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

Testing

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