Snippets Contact form

Bootstrap 5 Contact Form with Info Panel

A split contact card with a floating-label message form beside an indigo panel holding email, phone and address details.

Bootstrap 5 No jQuery Oct 2020 2.2K views

<section class="wdw-stage">
  <div class="container" style="max-width:1000px">
    <div class="wdw-card overflow-hidden">
      <div class="row g-0">
        <div class="col-lg-7 p-4 p-md-5">
          <span class="wdw-eyebrow mb-2">Contact</span>
          <h2 class="wdw-heading h3 mb-1">Send us a message</h2>
          <p class="wdw-muted mb-4">We usually reply within one business day.</p>
          <form id="contactForm" novalidate>
            <div class="row g-3">
              <div class="col-sm-6"><div class="form-floating"><input type="text" class="form-control" id="cfFirst" placeholder="First name" required><label for="cfFirst">First name</label><div class="invalid-feedback">Please enter your first name.</div></div></div>
              <div class="col-sm-6"><div class="form-floating"><input type="text" class="form-control" id="cfLast" placeholder="Last name" required><label for="cfLast">Last name</label><div class="invalid-feedback">Please enter your last name.</div></div></div>
              <div class="col-sm-6"><div class="form-floating"><input type="email" class="form-control" id="cfEmail" placeholder="Email" required><label for="cfEmail">Email</label><div class="invalid-feedback">Enter a valid email.</div></div></div>
              <div class="col-sm-6"><div class="form-floating"><input type="tel" class="form-control" id="cfPhone" placeholder="Phone"><label for="cfPhone">Phone (optional)</label></div></div>
              <div class="col-12"><div class="form-floating"><textarea class="form-control cf-text" id="cfMsg" placeholder="Message" required></textarea><label for="cfMsg">How can we help?</label><div class="invalid-feedback">Tell us a little about your project.</div></div></div>
              <div class="col-12 d-flex flex-wrap align-items-center gap-3">
                <button type="submit" class="btn btn-primary rounded-pill px-4">Send message</button>
                <span class="small text-success d-none" id="cfOk" role="status">Thanks! Your message is on its way.</span>
              </div>
            </div>
          </form>
        </div>
        <div class="col-lg-5 wdw-aurora p-4 p-md-5 d-flex flex-column justify-content-center">
          <h3 class="h4 fw-bold mb-4">Get in touch</h3>
          <ul class="list-unstyled d-grid gap-4 mb-4">
            <li class="d-flex gap-3"><span class="cf-ico"><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"><rect x="3" y="5" width="18" height="14" rx="2"/><path d="m3 7 9 6 9-6"/></svg></span><div><div class="small opacity-75">Email</div><a class="text-white text-decoration-none" href="mailto:[email protected]">[email protected]</a></div></li>
            <li class="d-flex gap-3"><span class="cf-ico"><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="M22 16.9v3a2 2 0 0 1-2.2 2 19.8 19.8 0 0 1-8.6-3.1 19.5 19.5 0 0 1-6-6A19.8 19.8 0 0 1 2.1 4.2 2 2 0 0 1 4.1 2h3a2 2 0 0 1 2 1.7c.1 1 .4 1.9.7 2.8a2 2 0 0 1-.5 2.1L8.1 9.9a16 16 0 0 0 6 6l1.3-1.3a2 2 0 0 1 2.1-.4c.9.3 1.8.6 2.8.7a2 2 0 0 1 1.7 2z"/></svg></span><div><div class="small opacity-75">Phone</div><a class="text-white text-decoration-none" href="tel:+10215551234">(021) 555-1234</a></div></li>
            <li class="d-flex gap-3"><span class="cf-ico"><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="M20 10c0 6-8 12-8 12S4 16 4 10a8 8 0 0 1 16 0z"/><circle cx="12" cy="10" r="3"/></svg></span><div><div class="small opacity-75">Studio</div>2694 Queen City Drive<br>Florida 99161</div></li>
          </ul>
          <a href="#" class="btn btn-light rounded-pill align-self-start px-4">Get directions
            <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M5 12h14M13 6l6 6-6 6"/></svg></a>
        </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.