Password Rules Popover
Sign-up form whose password field drops a rules popover over the field below it, showing a four-segment strength meter and ticking off the requirements already met.
- lines of CSS
- 96lines of CSS
- dependencies
- 0dependencies
- browser, for years
- Everybrowser, for years
- motion only on interaction
- Hovermotion only on interaction
Vue, Svelte, styled-components and Tailwind exports are part of Pro. HTML, CSS and React are free forever.
.fx-v14-tt-pwrules-15702 {
position: relative;
width: 226px;
height: 136px;
padding: 0.7rem 0.8rem;
background: #111a2c;
border: 1px solid #253049;
border-radius: 0.7rem;
box-shadow: 0 18px 36px rgba(0,0,0,0.5);
}
.fx-v14-tt-pwrules-15702 .lb { display: block; margin-bottom: 3px; font-size: 0.6rem; color: #64748b; }
.fx-v14-tt-pwrules-15702 .f {
display: flex;
align-items: center;
justify-content: space-between;
height: 26px;
margin-bottom: 0.55rem;
padding: 0 0.5rem;
font-size: 0.72rem;
letter-spacing: 0.06em;
color: #e2e8f0;
background: #0d1526;
border: 1px solid #2b3a58;
border-radius: 0.35rem;
transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.fx-v14-tt-pwrules-15702 .f svg { color: #64748b; }
.fx-v14-tt-pwrules-15702 .g { opacity: 0.5; }
.fx-v14-tt-pwrules-15702 .pop {
position: absolute;
top: 54px;
left: 12px;
right: 12px;
padding: 0.4rem 0.55rem 0.4rem;
background: #16203a;
border: 1px solid #33415f;
border-radius: 0.5rem;
box-shadow: 0 18px 34px rgba(0,0,0,0.65);
opacity: 0;
transform: translateY(-7px);
pointer-events: none;
transition: opacity 0.2s ease, transform 0.24s ease;
}
.fx-v14-tt-pwrules-15702 .pop::before {
content: '';
position: absolute;
bottom: 100%;
left: 22px;
border: 5px solid transparent;
border-bottom-color: #33415f;
}
.fx-v14-tt-pwrules-15702 .bar { display: flex; gap: 3px; }
.fx-v14-tt-pwrules-15702 .bar i { flex: 1; height: 3px; border-radius: 2px; background: #2b3a58; }
.fx-v14-tt-pwrules-15702 .bar .on { background: #34d399; }
.fx-v14-tt-pwrules-15702 .pop em {
display: block;
margin: 0.3rem 0 0.32rem;
font-style: normal;
font-size: 0.6rem;
color: #6ee7b7;
}
.fx-v14-tt-pwrules-15702 .pop u {
display: block;
position: relative;
padding-left: 14px;
font-size: 0.62rem;
line-height: 1.42;
text-decoration: none;
color: #64748b;
}
.fx-v14-tt-pwrules-15702 .pop u::before {
content: '';
position: absolute;
top: 6px;
left: 2px;
width: 6px;
height: 6px;
border-radius: 50%;
background: #3d4c6b;
}
.fx-v14-tt-pwrules-15702 .pop .ok { color: #cbd5e1; }
.fx-v14-tt-pwrules-15702 .pop .ok::before {
top: 4px;
left: 0;
width: 8px;
height: 4px;
border: 1.6px solid #34d399;
border-top: 0;
border-right: 0;
border-radius: 0;
background: none;
transform: rotate(-45deg);
}
.fx-v14-tt-pwrules-15702:hover .f, .fx-v14-tt-pwrules-15702:focus-within .f { border-color: #6366f1; }
.fx-v14-tt-pwrules-15702:hover .g, .fx-v14-tt-pwrules-15702:focus-within .g { border-color: #2b3a58; }
.fx-v14-tt-pwrules-15702:hover .pop, .fx-v14-tt-pwrules-15702:focus-within .pop { opacity: 1; transform: translateY(0); }<div class="fx-v14-tt-pwrules-15702">
<span class="lb">New password</span>
<div class="f">••••••••••<svg viewBox="0 0 24 24" width="13" height="13" fill="none" stroke="currentColor" stroke-width="2"><path d="M2 12s3.6-6 10-6 10 6 10 6-3.6 6-10 6S2 12 2 12z"></path><circle cx="12" cy="12" r="2.6"></circle></svg></div>
<span class="lb">Confirm password</span>
<div class="f g"></div>
<div class="pop">
<div class="bar">
<i class="on"></i>
<i class="on"></i>
<i class="on"></i>
<i></i>
</div>
<em>Strength: good</em>
<u class="ok">At least 12 characters</u>
<u class="ok">One number</u>
<u>One symbol</u>
</div>
</div>What do I do with this?
- Put
password-rules-popover-15703.cssanywhere your page already loads CSS from — in Next.js that isapp/globals.css, or any stylesheet with a<link>in your HTML. - Then put the class on the element you want it on:
<button class="fx-v14-tt-pwrules-15702">. The CSS does nothing until a class name in it matches something on the page.
- Link the stylesheet, then paste the markup wherever you need it.
npx hoverlab add password-rules-popover-15703What's included
- The markup and the stylesheet, in whichever framework you pick
- No runtime dependencies
Works with
- React
- Vue
- Svelte
- Tailwind
- styled-components
- Plain CSS
npx hoverlab add password-rules-popover-15703
Or over MCP, from your editor's agent — no account needed.
License
Free to read, copy and install, for personal and non-commercial projects. Shipping it in client work or a paid product needs Pro ($79 once). The source lands in your repo and stops being ours — no attribution, nothing to upgrade.
Motion safety
Static estimate, read from the CSS
- Reduced motion
- Brief motion, no guard
Animates briefly or on interaction. Only looping motion gets a guard in this catalog; copy the one from the Insights tab if this ships on a critical path.
- What it animates
- Repaints
Animates
border-color. No reflow, but the browser repaints every frame, which is fine for one element and costly across many. - Flashing (WCAG 2.3.1)
- No flashing found
No repeating change in opacity, colour or brightness large enough to count as a flash.
- Layout shift (CLS)
- No shift expected
Nothing it animates moves or resizes the box in flow. A category from the CSS, not a measurement for this effect.
Every row is read from the shipped CSS. Only a figure marked measured came from a browser. Customizing the speed changes the timing, so recheck a customized copy. How it is computed
28 more effects in Tooltips & Popovers
All of them free to read, copy and install — no account, no locked tiles, no watermarked preview. The whole catalog is open, and so are the API and the CLI.
Browse Tooltips & PopoversShipping one commercially
Copying the code is free. Putting it in client work or a paid product is what Pro is for — the licence, not the access.
- A commercial licence for everything in the catalog
- Unlimited bundle exports, in Vue, Svelte and Tailwind
- One payment — no subscription, nothing to renew
7 variations of Password Rules Popover
Finished looks, each one a position in the customizer above. Copy any of them, or open it and keep moving the sliders.