09 / 28
All 28 in 28 Tailwind CSS Input Fields
- 01Tailwind Floating Label Input
- 02Tailwind Underline Sweep Input
- 03Tailwind Neon Glow Input
- 04Tailwind Frosted Glass Input
- 05Tailwind Notched Outline Input
- 06Tailwind Drawn Border Input
- 07Tailwind Inline Validation Input
- 08Tailwind Search Input With Clear
- 09Tailwind Password Strength Meter
- 10Tailwind OTP Code Input
- 11Tailwind Rotating Placeholder Input
- 12Tailwind Tag Chip Input
- 13Tailwind Phone Input With Country
- 14Tailwind Stepper Number Input
- 15Tailwind File Drop Zone
- 16Tailwind Currency Input
- 17Tailwind Native Date Input
- 18Tailwind Time Range Input
- 19Tailwind Colour Picker Input
- 20Tailwind Voice Search Input
- 21Tailwind Email Suggestion Combobox
- 22Tailwind Auto-Grow Textarea
- 23Tailwind Inline Edit Field
- 24Tailwind Range Slider
- 25Tailwind URL Input With Protocol
- 26Tailwind Credit Card Input
- 27Tailwind Password Toggle Input
- 28Tailwind Brutalist Input
Tailwind Password Strength Meter
A live strength bar graded from native constraints alone — minlength and a character-class pattern, read through group-has-[…] into four bar widths. No scoring library, no script.
Untitled UI Pro: 5,000+ React + Tailwind CSS v4 components · from $349 one-time
Untitled UI React · Affiliate link
The code
<div class="tif-09 grid min-h-svh w-full place-items-center bg-tif09-bg px-6 py-14 font-tif09-sans" aria-label="Password strength meter demo">
<label class="group grid w-full max-w-70 gap-1.5 text-[11px] text-tif09-mut">
<span class="font-semibold">Password</span>
<input type="password" name="tif09-pw" autocomplete="new-password" placeholder="At least 12 characters" minlength="12" pattern="(?=.*\d)(?=.*[^A-Za-z0-9]).{12,}" required aria-describedby="tif09-hint"
class="w-full rounded-lg border border-white/10 bg-tif09-field px-3.5 py-2.5 text-sm text-tif09-ink outline-none transition-colors duration-200 focus:border-tif09-acc">
<span class="relative h-1 overflow-hidden rounded-full bg-white/8" aria-hidden="true">
<span class="absolute inset-y-0 left-0 w-0 rounded-full bg-linear-to-r from-tif09-bad via-tif09-warn to-tif09-ok transition-[width] duration-300 ease-out group-has-[input:not(:placeholder-shown):invalid]:w-[30%] group-has-[input:not(:placeholder-shown):valid]:w-[65%] group-has-[input:focus:valid]:w-full motion-reduce:transition-none"></span>
</span>
<span id="tif09-hint" class="text-[10.5px] text-tif09-mut">Use 12+ characters with letters, numbers, and a symbol.</span>
</label>
</div><div class="tif-09 grid min-h-svh w-full place-items-center bg-tif09-bg px-6 py-14 font-tif09-sans" aria-label="Password strength meter demo">
<label class="group grid w-full max-w-70 gap-1.5 text-[11px] text-tif09-mut">
<span class="font-semibold">Password</span>
<input type="password" name="tif09-pw" autocomplete="new-password" placeholder="At least 12 characters" minlength="12" pattern="(?=.*\d)(?=.*[^A-Za-z0-9]).{12,}" required aria-describedby="tif09-hint"
class="w-full rounded-lg border border-white/10 bg-tif09-field px-3.5 py-2.5 text-sm text-tif09-ink outline-none transition-colors duration-200 focus:border-tif09-acc">
<span class="relative h-1 overflow-hidden rounded-full bg-white/8" aria-hidden="true">
<span class="absolute inset-y-0 left-0 w-0 rounded-full bg-linear-to-r from-tif09-bad via-tif09-warn to-tif09-ok transition-[width] duration-300 ease-out group-has-[input:not(:placeholder-shown):invalid]:w-[30%] group-has-[input:not(:placeholder-shown):valid]:w-[65%] group-has-[input:focus:valid]:w-full motion-reduce:transition-none"></span>
</span>
<span id="tif09-hint" class="text-[10.5px] text-tif09-mut">Use 12+ characters with letters, numbers, and a symbol.</span>
</label>
</div>@import "tailwindcss";
@theme {
--color-tif09-bg: #12121a;
--color-tif09-bg: oklch(0.19 0.015 285);
--color-tif09-field: #1a1a22;
--color-tif09-field: oklch(0.23 0.015 285);
--color-tif09-ink: #f0eeff;
--color-tif09-ink: oklch(0.95 0.02 290);
--color-tif09-mut: #b8b6d4;
--color-tif09-mut: oklch(0.77 0.03 290);
--color-tif09-acc: #c084fc;
--color-tif09-acc: oklch(0.75 0.17 305);
--color-tif09-bad: #ef4444;
--color-tif09-bad: oklch(0.63 0.22 27);
--color-tif09-warn: #f59e0b;
--color-tif09-warn: oklch(0.76 0.16 70);
--color-tif09-ok: #22c55e;
--color-tif09-ok: oklch(0.73 0.19 145);
--font-tif09-sans: 'Plus Jakarta Sans', system-ui, sans-serif;
}
.tif-09 {
width: 100%;
}
.tif-09 ::selection {
background: var(--color-tif09-acc);
color: #12121a;
}@import "tailwindcss";
@theme {
--color-tif09-bg: #12121a;
--color-tif09-bg: oklch(0.19 0.015 285);
--color-tif09-field: #1a1a22;
--color-tif09-field: oklch(0.23 0.015 285);
--color-tif09-ink: #f0eeff;
--color-tif09-ink: oklch(0.95 0.02 290);
--color-tif09-mut: #b8b6d4;
--color-tif09-mut: oklch(0.77 0.03 290);
--color-tif09-acc: #c084fc;
--color-tif09-acc: oklch(0.75 0.17 305);
--color-tif09-bad: #ef4444;
--color-tif09-bad: oklch(0.63 0.22 27);
--color-tif09-warn: #f59e0b;
--color-tif09-warn: oklch(0.76 0.16 70);
--color-tif09-ok: #22c55e;
--color-tif09-ok: oklch(0.73 0.19 145);
--font-tif09-sans: 'Plus Jakarta Sans', system-ui, sans-serif;
}
.tif-09 {
width: 100%;
}
.tif-09 ::selection {
background: var(--color-tif09-acc);
color: #12121a;
}Setup — do this once per project
Skip this if your project already runs Tailwind v4.
<script src="https://cdn.jsdelivr.net/npm/@tailwindcss/browser@4"></script>
<script src="https://cdn.jsdelivr.net/npm/@tailwindcss/browser@4"></script>Compiles in the browser — perfect for a CodePen or a quick test, not for production.
npm install tailwindcss @tailwindcss/vite
npm install tailwindcss @tailwindcss/vite// vite.config.js ("type": "module" in package.json)
import { defineConfig } from 'vite'
import tailwindcss from '@tailwindcss/vite'
export default defineConfig({
plugins: [tailwindcss()],
})// vite.config.js ("type": "module" in package.json)
import { defineConfig } from 'vite'
import tailwindcss from '@tailwindcss/vite'
export default defineConfig({
plugins: [tailwindcss()],
})Any v4 setup works — Vite, PostCSS or the CLI. Nothing in this demo is bundler-specific.
@import "tailwindcss";
@theme {
--color-tif09-bg: #12121a;
--color-tif09-bg: oklch(0.19 0.015 285);
--color-tif09-field: #1a1a22;
--color-tif09-field: oklch(0.23 0.015 285);
--color-tif09-ink: #f0eeff;
--color-tif09-ink: oklch(0.95 0.02 290);
--color-tif09-mut: #b8b6d4;
--color-tif09-mut: oklch(0.77 0.03 290);
--color-tif09-acc: #c084fc;
--color-tif09-acc: oklch(0.75 0.17 305);
--color-tif09-bad: #ef4444;
--color-tif09-bad: oklch(0.63 0.22 27);
--color-tif09-warn: #f59e0b;
--color-tif09-warn: oklch(0.76 0.16 70);
--color-tif09-ok: #22c55e;
--color-tif09-ok: oklch(0.73 0.19 145);
--font-tif09-sans: 'Plus Jakarta Sans', system-ui, sans-serif;
}
.tif-09 {
width: 100%;
}
.tif-09 ::selection {
background: var(--color-tif09-acc);
color: #12121a;
}@import "tailwindcss";
@theme {
--color-tif09-bg: #12121a;
--color-tif09-bg: oklch(0.19 0.015 285);
--color-tif09-field: #1a1a22;
--color-tif09-field: oklch(0.23 0.015 285);
--color-tif09-ink: #f0eeff;
--color-tif09-ink: oklch(0.95 0.02 290);
--color-tif09-mut: #b8b6d4;
--color-tif09-mut: oklch(0.77 0.03 290);
--color-tif09-acc: #c084fc;
--color-tif09-acc: oklch(0.75 0.17 305);
--color-tif09-bad: #ef4444;
--color-tif09-bad: oklch(0.63 0.22 27);
--color-tif09-warn: #f59e0b;
--color-tif09-warn: oklch(0.76 0.16 70);
--color-tif09-ok: #22c55e;
--color-tif09-ok: oklch(0.73 0.19 145);
--font-tif09-sans: 'Plus Jakarta Sans', system-ui, sans-serif;
}
.tif-09 {
width: 100%;
}
.tif-09 ::selection {
background: var(--color-tif09-acc);
color: #12121a;
}<link rel="preconnect" href="https://fonts.googleapis.com"> <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap">What changed in the port
Which parts became utilities, which stayed CSS, and why.
- Bug fixed. The CSS original's demo 09 is two stylesheets stacked: a strength meter, then a password-toggle sheet redefining
.if-09,.if-09-labeland.if-09 inputwith markup that does not exist in the demo. This entry is the strength meter alone; the toggle is entry 27. - The
minlength="6"that contradicted a "12+ characters" hint is nowminlength="12"with a matchingpattern, so the bar and the copy agree. aria-describedbyadded: the gradient says nothing to a screen reader, the hint does.
Here's a working CSS demo from CodeFronts. Use it as-is or adapt to your framework. All classes are scoped under a unique prefix so the code won't collide with your existing styles. MIT licensed.
Demo: Tailwind Password Strength Meter
Source: https://codefronts.com/components/tailwind-css-input-fields/tailwind-password-strength-meter/
A live strength bar graded from native constraints alone — minlength and a character-class pattern, read through group-has-[…] into four bar widths. No scoring library, no script.
## HTML
```html
<div class="tif-09 grid min-h-svh w-full place-items-center bg-tif09-bg px-6 py-14 font-tif09-sans" aria-label="Password strength meter demo">
<label class="group grid w-full max-w-70 gap-1.5 text-[11px] text-tif09-mut">
<span class="font-semibold">Password</span>
<input type="password" name="tif09-pw" autocomplete="new-password" placeholder="At least 12 characters" minlength="12" pattern="(?=.*\d)(?=.*[^A-Za-z0-9]).{12,}" required aria-describedby="tif09-hint"
class="w-full rounded-lg border border-white/10 bg-tif09-field px-3.5 py-2.5 text-sm text-tif09-ink outline-none transition-colors duration-200 focus:border-tif09-acc">
<span class="relative h-1 overflow-hidden rounded-full bg-white/8" aria-hidden="true">
<span class="absolute inset-y-0 left-0 w-0 rounded-full bg-linear-to-r from-tif09-bad via-tif09-warn to-tif09-ok transition-[width] duration-300 ease-out group-has-[input:not(:placeholder-shown):invalid]:w-[30%] group-has-[input:not(:placeholder-shown):valid]:w-[65%] group-has-[input:focus:valid]:w-full motion-reduce:transition-none"></span>
</span>
<span id="tif09-hint" class="text-[10.5px] text-tif09-mut">Use 12+ characters with letters, numbers, and a symbol.</span>
</label>
</div>
```
## CSS
```css
@import "tailwindcss";
@theme {
--color-tif09-bg: #12121a;
--color-tif09-bg: oklch(0.19 0.015 285);
--color-tif09-field: #1a1a22;
--color-tif09-field: oklch(0.23 0.015 285);
--color-tif09-ink: #f0eeff;
--color-tif09-ink: oklch(0.95 0.02 290);
--color-tif09-mut: #b8b6d4;
--color-tif09-mut: oklch(0.77 0.03 290);
--color-tif09-acc: #c084fc;
--color-tif09-acc: oklch(0.75 0.17 305);
--color-tif09-bad: #ef4444;
--color-tif09-bad: oklch(0.63 0.22 27);
--color-tif09-warn: #f59e0b;
--color-tif09-warn: oklch(0.76 0.16 70);
--color-tif09-ok: #22c55e;
--color-tif09-ok: oklch(0.73 0.19 145);
--font-tif09-sans: 'Plus Jakarta Sans', system-ui, sans-serif;
}
.tif-09 {
width: 100%;
}
.tif-09 ::selection {
background: var(--color-tif09-acc);
color: #12121a;
}
```Here's a working CSS demo from CodeFronts. Use it as-is or adapt to your framework. All classes are scoped under a unique prefix so the code won't collide with your existing styles. MIT licensed.
Demo: Tailwind Password Strength Meter
Source: https://codefronts.com/components/tailwind-css-input-fields/tailwind-password-strength-meter/
A live strength bar graded from native constraints alone — minlength and a character-class pattern, read through group-has-[…] into four bar widths. No scoring library, no script.
## HTML
```html
<div class="tif-09 grid min-h-svh w-full place-items-center bg-tif09-bg px-6 py-14 font-tif09-sans" aria-label="Password strength meter demo">
<label class="group grid w-full max-w-70 gap-1.5 text-[11px] text-tif09-mut">
<span class="font-semibold">Password</span>
<input type="password" name="tif09-pw" autocomplete="new-password" placeholder="At least 12 characters" minlength="12" pattern="(?=.*\d)(?=.*[^A-Za-z0-9]).{12,}" required aria-describedby="tif09-hint"
class="w-full rounded-lg border border-white/10 bg-tif09-field px-3.5 py-2.5 text-sm text-tif09-ink outline-none transition-colors duration-200 focus:border-tif09-acc">
<span class="relative h-1 overflow-hidden rounded-full bg-white/8" aria-hidden="true">
<span class="absolute inset-y-0 left-0 w-0 rounded-full bg-linear-to-r from-tif09-bad via-tif09-warn to-tif09-ok transition-[width] duration-300 ease-out group-has-[input:not(:placeholder-shown):invalid]:w-[30%] group-has-[input:not(:placeholder-shown):valid]:w-[65%] group-has-[input:focus:valid]:w-full motion-reduce:transition-none"></span>
</span>
<span id="tif09-hint" class="text-[10.5px] text-tif09-mut">Use 12+ characters with letters, numbers, and a symbol.</span>
</label>
</div>
```
## CSS
```css
@import "tailwindcss";
@theme {
--color-tif09-bg: #12121a;
--color-tif09-bg: oklch(0.19 0.015 285);
--color-tif09-field: #1a1a22;
--color-tif09-field: oklch(0.23 0.015 285);
--color-tif09-ink: #f0eeff;
--color-tif09-ink: oklch(0.95 0.02 290);
--color-tif09-mut: #b8b6d4;
--color-tif09-mut: oklch(0.77 0.03 290);
--color-tif09-acc: #c084fc;
--color-tif09-acc: oklch(0.75 0.17 305);
--color-tif09-bad: #ef4444;
--color-tif09-bad: oklch(0.63 0.22 27);
--color-tif09-warn: #f59e0b;
--color-tif09-warn: oklch(0.76 0.16 70);
--color-tif09-ok: #22c55e;
--color-tif09-ok: oklch(0.73 0.19 145);
--font-tif09-sans: 'Plus Jakarta Sans', system-ui, sans-serif;
}
.tif-09 {
width: 100%;
}
.tif-09 ::selection {
background: var(--color-tif09-acc);
color: #12121a;
}
```How this works
The grade is four widths. Each is a variant on the fill, and only one can match at a time because the selectors are mutually exclusive:
class="w-0 group-has-[input:not(:placeholder-shown):invalid]:w-[30%]
group-has-[input:valid]:w-[65%] group-has-[input:focus:valid]:w-full"Native constraints are the scorer. minlength="8" plus a pattern demanding a digit and a symbol is genuinely most of what a strength meter measures. What it cannot measure is entropy or dictionary hits — for that you need zxcvbn and a script, and this is honestly not that.
Make it yours
- Grade harder: tighten the
pattern—(?=.*\d)(?=.*[!@#$%^&*])is already in the markup; add length or case classes. - Bands: the four width values. 30/65/100 is a feel, not a law.
- Colours: the three gradient stops in
@theme. - Ease:
duration-300on the fill; faster reads as twitchy while typing.
Gotchas — read before shipping
- This grades form constraints, not password quality. It cannot know that
Passw0rd!is terrible. - The
placeholdermust be non-empty for the empty-state rule to fire. - A visual bar is invisible to screen readers — the
aria-describedbyhint is the actual accessible feedback, not the gradient.
Browser support
| Chrome | Safari | Firefox | Edge |
|---|---|---|---|
| 111+ | 16.4+ | 128+ | 111+ |
:has() is Baseline; without it the bar stays empty and the password field works normally.