Snippets Form

Bootstrap 5 Signup Form with Google Login Button

A clean sign-up card with a Google button, floating-label fields, a live password strength meter and inline validation.

Bootstrap 5 No jQuery Apr 2020 8.4K views

<section class="wdw-stage">
  <div class="container" style="max-width: 940px">
    <div class="wdw-card overflow-hidden">
      <div class="row g-0">
        <div class="col-lg-5 d-none d-lg-flex wdw-aurora p-5 flex-column justify-content-between signup-brand">
          <span class="fw-bold fs-5">Northwind</span>
          <div>
            <h2 class="h3 fw-bold mb-3">Ship your next idea this week.</h2>
            <ul class="list-unstyled d-grid gap-2 mb-0 small">
              <li class="d-flex gap-2 align-items-center"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m5 12.5 4.5 4.5L19 7.5"/></svg>Unlimited projects on the free plan</li>
              <li class="d-flex gap-2 align-items-center"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m5 12.5 4.5 4.5L19 7.5"/></svg>No credit card required</li>
              <li class="d-flex gap-2 align-items-center"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m5 12.5 4.5 4.5L19 7.5"/></svg>Cancel or export any time</li>
            </ul>
          </div>
        </div>
        <div class="col-lg-7 p-4 p-sm-5">
          <h1 class="wdw-heading h4 mb-1">Create your account</h1>
          <p class="wdw-muted mb-4">Free forever. Takes less than a minute.</p>

          <button type="button" class="btn btn-outline-secondary border-secondary-subtle text-body-emphasis bg-body rounded-pill w-100 google-btn" id="googleBtn">
            <svg width="18" height="18" viewBox="0 0 48 48" aria-hidden="true"><path fill="#EA4335" d="M24 9.5c3.5 0 6.6 1.2 9.1 3.5l6.8-6.8C35.800 2.400 30.300 0 24 0 14.600 0 6.500 5.400 2.600 13.200l7.900 6.100C12.400 13.600 17.700 9.500 24 9.500z"/><path fill="#4285F4" d="M46.500 24.500c0-1.600-.1-3.100-.4-4.500H24v9h12.700c-.6 3-2.300 5.500-4.800 7.200l7.600 5.900c4.400-4.100 7-10.100 7-17.600z"/><path fill="#FBBC05" d="M10.500 28.700A14.500 14.500 0 0 1 9.500 24c0-1.600.3-3.200.8-4.700l-7.900-6.100A24 24 0 0 0 0 24c0 3.900.9 7.500 2.600 10.800l7.900-6.100z"/><path fill="#34A853" d="M24 48c6.500 0 11.900-2.100 15.900-5.800l-7.600-5.900c-2.100 1.400-4.900 2.300-8.300 2.300-6.300 0-11.600-4.100-13.500-9.800l-7.900 6.100C6.500 42.600 14.600 48 24 48z"/></svg>
            Continue with Google
          </button>

          <div class="d-flex align-items-center gap-3 my-4 text-body-secondary small" role="separator">
            <hr class="flex-grow-1 m-0"><span>or sign up with email</span><hr class="flex-grow-1 m-0">
          </div>

          <form id="signupForm" class="d-grid gap-3" novalidate>
            <div class="form-floating">
              <input type="text" class="form-control" id="suName" placeholder="Display name" autocomplete="name" required>
              <label for="suName">Display name</label>
            </div>
            <div class="form-floating">
              <input type="email" class="form-control" id="suEmail" placeholder="Email" autocomplete="email" required>
              <label for="suEmail">Email address</label>
              <div class="invalid-feedback">Enter a valid email address.</div>
            </div>
            <div>
              <div class="input-group has-validation">
                <div class="form-floating flex-grow-1">
                  <input type="password" class="form-control" id="suPass" placeholder="Password" autocomplete="new-password" minlength="8" aria-describedby="suHint" required>
                  <label for="suPass">Password</label>
                </div>
                <button type="button" class="btn btn-outline-secondary border-secondary-subtle text-body-secondary" id="suToggle" aria-label="Show password" aria-pressed="false">
                  <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7S2 12 2 12z"/><circle cx="12" cy="12" r="3"/></svg>
                </button>
                <div class="invalid-feedback">Use at least 8 characters.</div>
              </div>
              <div class="suMeterWrap d-none mt-2" id="suMeterWrap">
                <div class="progress" style="height:4px" aria-hidden="true"><div class="progress-bar" id="suMeter" style="width:0"></div></div>
                <div class="d-flex justify-content-between small mt-1"><span class="wdw-muted" id="suHint">8+ characters, mixed case, a number</span><span class="fw-semibold" id="suLabel"></span></div>
              </div>
            </div>
            <div class="form-floating">
              <input type="password" class="form-control" id="suPass2" placeholder="Repeat password" autocomplete="new-password" required>
              <label for="suPass2">Repeat password</label>
              <div class="invalid-feedback">Passwords do not match.</div>
            </div>
            <div class="form-check">
              <input class="form-check-input" type="checkbox" id="suTerms" required>
              <label class="form-check-label small" for="suTerms">I agree to the <a href="#" class="fw-semibold text-decoration-none">Terms</a> and <a href="#" class="fw-semibold text-decoration-none">Privacy Policy</a></label>
              <div class="invalid-feedback">Please accept the terms to continue.</div>
            </div>
            <button type="submit" class="btn btn-primary rounded-pill w-100">Create account</button>
            <div class="alert alert-success d-none mb-0 rounded-4" id="suOk" role="status">Account created. Welcome aboard!</div>
          </form>

          <p class="text-center wdw-muted small mt-4 mb-0">Already have an account? <a href="#" class="fw-semibold text-decoration-none">Log in</a></p>
        </div>
      </div>
    </div>
  </div>
</section>

Built on Bootstrap 5.3.8 with plain JavaScript — no jQuery. Supports light and dark mode via data-bs-theme.

Free to use in personal and commercial projects under the MIT license.