← Back to the blog

Free HTML and CSS Login Form Templates That Work With Password Managers

By Mark Fail · · Updated

Free HTML and CSS Login Form Templates That Work With Password Managers

A login form is the one piece of HTML that every visitor has to get through, and most of the free ones online are built to look good in a screenshot. Copy one into a real project and the password manager doesn't offer to fill it, keyboard users can't see which field they're in, and sometimes the password lands in the address bar.

So I tested six free login forms on 7 October 2026 against a short list. Every field needs a real label, the autocomplete values browsers expect, a focus style you can actually see, and a form that sends the password by POST and nowhere else. None of the six passed every check, but some need two minutes of fixing and some need an hour.

At a glance

Form Licence Needs Autocomplete Focus style Best for
Bootstrap sign-inMITBootstrap 5.3MissingFaint glowBootstrap projects
Tabler sign-inMITTabler CSSSet2px outlineAdmin panels
Colorlib login formsNo licence fileNothingSet2px outlinePicking a visual style
Flowbite loginMITTailwind CSSMissingRingTailwind sites
shadcn/ui loginMITReact, TailwindMissing3px ringNext.js apps
GOV.UK password inputMITGOV.UK FrontendSet3px yellow outlineForms that must pass an audit

Bootstrap sign-in

Bootstrap 5.3 sign-in example with floating email and password fields, remember me checkbox and blue sign in button

Bootstrap's own Sign-in example is the form most Bootstrap projects start from. It is tiny. A logo, a "Please sign in" heading, two floating-label fields stacked into one box, a Remember me checkbox and a full-width blue button. The custom CSS file is about 20 lines long.

Look at the markup before you ship it. The inputs have labels and the right types, but no name attributes, no autocomplete values and no method on the form. As written it submits nothing. Add names without adding method="post" and the browser defaults to GET, which puts the password in the URL. Bootstrap's focus style turns the outline off and draws a light blue glow at 25% opacity instead. It comes with Bootstrap 5.3.8 under the MIT licence.

Pros

  • Real labels on both fields, using Bootstrap's floating label pattern
  • Correct email and password input types
  • Tiny, with almost no custom CSS
  • Dark mode works through Bootstrap's colour modes

Cons

  • No name, autocomplete or method attributes
  • The focus glow is faint, and box-shadow glows vanish in Windows contrast themes
  • No show-password button or error states
Visit Theme Page

Tabler sign-in

Tabler sign-in page with email and password fields, show password eye icon, remember me and GitHub and X login buttons

Tabler's sign-in page gets more right than any other framework page I tried. Labels sit above the fields. The email input has autocomplete="email" and the password has autocomplete="current-password". The eye icon is a real button with an aria-label of "Show password". Below the form there are GitHub and X login buttons and a sign-up link. Since version 1.6.0, released on 25 September, Tabler's focus indicator is a solid 2px outline.

One line needs changing. The form tag says method="get" and action="./", and the inputs have no names, so the demo sends nothing. The moment you add names for your backend, that GET sends the password in the query string. Change it to POST first. Tabler is MIT licensed, and version 1.6.1 came out on 28 September 2026. It also made our list of Bootstrap admin templates, where the rest of the kit is covered.

Pros

  • Correct autocomplete on both fields
  • Show-password toggle is a labelled button, not a bare icon
  • Visible 2px focus outline
  • Matches the rest of the Tabler admin kit

Cons

  • method="get" must be changed before you add field names
  • Needs Tabler's CSS and JS as well as the markup
  • The demo page carries a banner for Tabler's paid bundle
Visit Theme Page

Colorlib login forms

Colorlib glassmorphism login form on a purple gradient with email, password, Google and GitHub buttons

If you want a login form with some personality, this repository from Colorlib's Aigars Silkalns has 20 of them, from glassmorphism and neumorphism to a brutalist one and a banking style. Each sits in its own folder with plain HTML, CSS and JavaScript, no framework and no CDN. The glassmorphism version is shown above.

The April 2026 release cleaned up a lot. Version 2.0.0 added :focus-visible outlines to every form, honoured reduced-motion settings, and fixed an XSS bug where error messages were written with innerHTML. Fields have names, labels and autocomplete="email" and "current-password", and the show-password button has an aria-label.

Two problems are left. The shared validator rejects any password without an uppercase letter, a lowercase letter and a number, which is a sign-up rule, and on a sign-in form it locks out people whose older passwords don't fit. Then there is the licence. The repo has no LICENSE file, and GitHub's own docs say that without one, default copyright applies and nobody may reuse the code. Ask before you ship it. The repo has 58 stars, and its last release was version 2.0.0 on 28 April 2026.

Pros

  • 20 distinct designs, each self-contained
  • No dependencies at all
  • Focus outlines, reduced motion and autocomplete handled
  • Recent security fix for the error messages

Cons

  • No licence file, so reuse rights are unclear
  • Sign-in validation enforces sign-up password rules
  • Submits to a fake login function you must replace
  • No method on the form, so without JavaScript it falls back to GET
Visit Theme Page

Flowbite login

Flowbite free Tailwind CSS login block with email and password fields, remember me and forgot password link

Flowbite's login page lists several Tailwind login blocks, but only the first, "Default login page", shows its code for free. The rest are locked to Flowbite Pro buyers.

The free one is close to usable. It has labels, email and password types, and name attributes, so it really does submit. That is also the problem. The form has action="#" and no method, which means GET, so pressing Sign in puts the email and password into the URL. Neither field has an autocomplete value. The Remember me checkbox is marked required, so nobody can sign in without ticking it, and its aria-describedby points back at itself. The button removes its outline and uses a 4px Tailwind ring instead. Flowbite itself is MIT, and version 4.0.2 was published on npm on 13 May 2026.

Pros

  • Labels, names and input types all present
  • Clean Tailwind markup with dark mode classes
  • Flowbite's core library is MIT

Cons

  • No method, so it submits the password by GET
  • Remember me is required
  • No autocomplete values
  • Only one login block is free
Visit Theme Page

shadcn/ui login

shadcn/ui login-03 block with Apple and Google login buttons above email and password fields

This one is React, not plain HTML. I included it because a lot of people searching for a login template are building in Next.js, and many of them end up using shadcn/ui. The repository has 125,236 stars.

There are five login blocks. Login-03, above, puts Apple and Google buttons over the email form. You install a block with the shadcn CLI and the code is copied into your own project, so you own it from then on. Labels are wired with htmlFor, and inputs get a 3px focus ring. I read the source for all five, and none sets autocomplete or a name on its fields, so add both before you connect Auth.js, Supabase or your own API. The code is MIT, and the CLI's latest release, 4.21.3, came out on 6 October 2026.

Pros

  • Five layouts, including social login and split-screen versions
  • The code lives in your project, with no package to update
  • Proper labels and a visible focus ring
  • Very active project

Cons

  • React and Tailwind only
  • No autocomplete or name attributes in any of the five
  • The ring is a box-shadow with the outline removed
Visit Theme Page

GOV.UK password input

GOV.UK Design System password input component with label, black bordered field and Show button

The UK government's design system is not a login template, but its password input is the most carefully built field in this list and you can copy the pattern into anything.

The markup sets autocomplete="current-password", spellcheck="false" so browser spelling services never see the password, and autocapitalize="none". The Show button starts with the hidden attribute and only appears once JavaScript has loaded. Focus is a 3px yellow outline plus a thicker inner border, which stays visible in contrast themes. The guidance also says to use new-password on sign-up forms and to drop the "confirm password" field when a show button is present.

The one limit is branding. The GDS Transport font and GOV.UK look are for government services, so on your own site you swap the font and colours. GOV.UK Frontend is MIT, the password input arrived in version 5.3.0 in March 2024, and the current release is 6.5.1 from 14 September 2026.

Pros

  • The most complete attribute set of the six
  • Show button only appears when it works
  • Focus style that survives high-contrast modes
  • Backed by published user research

Cons

  • A single field, not a full login page
  • The GOV.UK font and branding can't be used outside government services
  • Pulling in all of GOV.UK Frontend is heavy for one form
Visit Theme Page

Ten CodePens

Most people looking for a login template end up on CodePen, so I opened ten login pens that came up in a search for one, made between 2013 and 2025, and read their source.

Nine of the ten set outline to none or 0 somewhere in their CSS, and none uses :focus-visible. Not one sets autocomplete="current-password", while three switch autocomplete off. Only four tie a text label to every field. Another uses labels that contain nothing but an icon, and in one pen the labels point at ids that don't exist. One pen even uses type="text" for the password, so it shows in clear text. Four need jQuery. CodePen makes public pens MIT licensed, so you are allowed to copy them. Most just aren't worth copying as they are.

If you would rather start clean, this is the markup I would use. It follows web.dev's sign-in guidance and the MDN autocomplete reference.

<form method="post" action="/login">
  <label for="username">Email</label>
  <input id="username" name="username" type="email" autocomplete="username" required>

  <label for="current-password">Password</label>
  <input id="current-password" name="password" type="password" autocomplete="current-password" required>

  <button type="submit">Sign in</button>
</form>

input:focus-visible, button:focus-visible {
  outline: 3px solid #1d4ed8
}

Style it however you like. Keep the outline, or swap it for another outline rather than a shadow. For a show-password button, add a type="button" element with a text label and a few lines of script that switch the input between password and text.

Final thoughts

For a plain HTML or Bootstrap site, take Tabler's sign-in page, change the method to POST and add names. It has the best accessibility of the framework pages.

If you only need the form and want to match an existing Bootstrap design, Bootstrap's Sign-in example works, but add names, autocomplete and a stronger focus style. Flowbite's free block is a fair Tailwind starting point once you add method="post", fix the required checkbox and add autocomplete. On React, the shadcn/ui blocks give you the layout and you add the attributes. The Colorlib set has the most style, though I would not ship it until the licence question is answered. Whichever you pick, copy the GOV.UK password field's attributes into it. They cost nothing and fix most of what the others miss.

FAQ

What autocomplete values should a login form use?
Use autocomplete="username" on the email or username field and autocomplete="current-password" on the password. Use new-password only on sign-up and change-password forms. These values tell browsers and password managers what to fill, and WCAG 2.2 criterion 1.3.5 expects the purpose of personal fields to be marked this way.
Should I set autocomplete="off" on a password field?
No. MDN notes that most modern browsers ignore it for login fields anyway, and blocking password managers works against WCAG 2.2 criterion 3.3.8, Accessible Authentication, which lists password manager support and paste as ways to meet it.
Why does my login form put the password in the URL?
Because the form has no method attribute, or method="get". A form without a method submits by GET, which adds every named field to the query string. MDN says never to send a password by GET. Set method="post".
Is it safe to remove the focus outline on login inputs?
Only if you replace it with something just as visible. WCAG 2.4.7 requires a visible focus indicator. A box-shadow ring is a weak replacement, because MDN documents that box-shadow is forced to none in forced colours mode, so Windows contrast theme users lose it.
Can I copy login forms from CodePen into a commercial project?
Public pens are MIT licensed according to CodePen's own documentation, so yes, if you keep the licence notice. GitHub repositories are different. A repo with no licence file stays under default copyright, and GitHub's docs say nobody may reuse the code without permission.
Does a login template include the backend?
None of these do. They are front-end markup. The checking of passwords, sessions, rate limiting and password resets has to come from your own server code or an auth service. The Colorlib forms, for example, call a fake login function that you replace.
Should a login form have a show password button?
Yes. It cuts typing errors, especially on phones, and the GOV.UK team found that with a show button a second "confirm password" field isn't needed on sign-up. Make it a real button with a text label, not an icon on its own.

Sources

Related Posts