Skip to content

Signup Form with Password Strength

Dark Bootstrap 6 signup form using the new Strength component, with a live password checklist, show/hide toggle, confirm field, terms checkbox and success state.

Also known as: signup form, registration form, password strength meter, create account form

Bootstrap 6 Login & Sign Up Responsive Dark #dark #form #password #signup #strength

Signup Form with Password Strength live demo

Open in new tab

Bootstrap 6 code (HTML, CSS, JS)

A dark Bootstrap 6 signup form built around the new Strength component. A four-segment meter rates the password as it is typed, and a live checklist shows which rules are met. The form also has a show/hide toggle, a confirm-password check, a terms checkbox and a "check your inbox" success state. It suits SaaS onboarding, developer tools and any create-account page.

How it works

.sps-root holds a two-column .sps-shell. The gradient .sps-aside lists plan benefits, and .sps-main holds the form. On narrow screens the columns stack.

The meter is Bootstrap 6 markup: <div class="strength" data-bs-strength> with four .strength-segment children and a sibling .strength-text. Strength finds the password input inside the same parent and colors the active segments by level (weak, fair, good, strong). data-bs-min-length="10" and the JSON in data-bs-messages set the length rule and the labels shown in .strength-text. The script gets the instance with Strength.getOrCreateInstance() and reads getStrength() on submit. Only "good" and "strong" (the ACCEPTED array) pass.

The .sps-rules list is separate from the meter. Each <li data-sps-rule> is checked by a function in the RULES object (length, case, number, symbol) on every input event. Met rules get .is-met and a filled check icon.

On submit, every field is validated. Errors set .is-invalid and aria-invalid, and focus moves to the first invalid field. The confirm field must match the password, and the terms .check must be ticked. After a simulated request, .sps-pane--done replaces the form. "Use a different email" resets the form and calls meter.evaluate() to clear the meter.

Customization

  • --sps-violet, --sps-pink and --sps-ok on .sps-root: change the brand gradient, the button and the "met" color. They are also mapped to --bs-primary-* for focus rings and checks.
  • --bs-strength-weak-color … --bs-strength-strong-color on .sps-strength: recolor the meter levels.
  • data-bs-messages on .sps-strength: change the label for each level. data-bs-min-length changes the length the meter rewards.
  • RULES in script.js: add or change checklist rules, and add a matching <li data-sps-rule="…">.
  • ACCEPTED in script.js: set it to ['strong'] to require a strong password.
  • Remove data-sps-demo from .sps-root in production. It fills sample values for the preview.
  • Replace the setTimeout in the submit handler with fetch('/api/signup', { method: 'POST', body: new FormData(form) }).

Use cases

  • SaaS onboarding: a four-segment meter rates the password as the user types
  • Developer tools: a live checklist shows which password rules are already met
  • Account creation: a confirm field and terms checkbox complete the form
  • Signup flows: a check your inbox screen appears after a successful submit

Accessibility

Each input has a visible label. The password input is described by the strength text and the rule list via aria-describedby, and .strength-text is a polite live region. The reveal button uses aria-pressed and a changing aria-label. After signup, focus moves to the success heading.

Bootstrap 6 notes

Bootstrap 5 had no password meter. Here it is .strength with data-bs-strength, initialised by the data API. btn-solid theme-primary replaces BS5's primary button class, and a plain .check in .form-field replaces the old checkbox wrapper. In 6.0.0-alpha.1, Strength also writes data-bs-strength onto .strength-text. If you set a value before DOMContentLoaded, the data API starts a second meter on that text, so the demo fill waits for load. Alpha APIs may still change. Icons are Bootstrap Icons.

Signup Form with Password Strength at a glance

Framework
Bootstrap 6
Code
HTML, CSS, JavaScript
JavaScript
Vanilla JavaScript, no jQuery
Dependencies
Bootstrap 6, Bootstrap Icons
Layout
Responsive, works on mobile, dark design
Category
Login & Sign Up
License
Free for personal and commercial use

Questions about this template

Can I use the Signup Form with Password Strength code for free?

Yes. You can copy or download the code and use it in personal and commercial projects, including client work. No sign-up is needed. Reselling it as part of a component library or template collection is not allowed; see the license.

How do I add it to my website?

Load Bootstrap 6 and Bootstrap Icons from a CDN (the links are under Requirements). Paste the HTML where the component should appear, add the CSS to your stylesheet and load the JavaScript before the closing </body> tag. Download HTML gives you a complete page with everything already linked.

Does it need jQuery or a JavaScript framework?

No. The script is plain vanilla JavaScript, so it works without jQuery, React or Vue. You can still use the markup inside those frameworks.

Does it work on mobile?

Yes. The layout adapts to small screens. Use the Mobile and Tablet buttons above the live demo to check it at phone and tablet width.

Requirements

Add these to your page (already included in the download):

  • <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@6.0.0-alpha.1/dist/css/bootstrap.min.css">
  • <script type="module" src="https://cdn.jsdelivr.net/npm/bootstrap@6.0.0-alpha.1/dist/js/bootstrap.bundle.min.js"></script>
  • <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css">

Built for Bootstrap 6.0.0-alpha.1. Bootstrap 6 ships as an ES module, so its script and this component's JavaScript load with type="module". Alpha releases can still change before the stable version.

Signup Form with Password Strength – Bootstrap 6 login & sign up component screenshot
Signup Form with Password Strength · Bootstrap 6 Login & Sign Up

More Login & Sign Up

Login Form with Floating Labels – Pure CSS login & sign up preview

Login Form with Floating Labels

Clean pure CSS login card with animated floating labels, show/hide password, inline validation and a simulated sign-in state in vanilla JavaScript.

Forgot Password Form – Tailwind CSS login & sign up preview

Forgot Password Form

Tailwind CSS forgot password form with email validation, loading spinner, check-your-inbox success state and a resend cooldown timer.

Signup Form with Validation – Bootstrap 5 login & sign up preview

Signup Form with Validation

Bootstrap 5 signup form with live password rules, a strength meter, show/hide toggle, password confirmation and a required terms checkbox.

Login and Signup Tabs – Bootstrap 6 login & sign up preview

Login and Signup Tabs

Bootstrap 6 card with segmented tabs that switch between a sign-in form and a create-account form, with validation, cross-links and simulated submits.

OTP Verification Form – Bootstrap 6 login & sign up preview

OTP Verification Form

Bootstrap 6 two-factor verification card using the new OtpInput component, with grouped digit slots, auto-submit, attempt limit, resend countdown and trust-device switch.

Split Login Page with Image – Bootstrap 6 login & sign up preview

Split Login Page with Image

Bootstrap 6 split-screen login page with a full-height photo and testimonial on one side and a floating-label form with Google and Apple sign-in on the other.