Snippets Form

Bootstrap 5 Contact Form with Map

A split contact section with a floating-label message form and phone link beside a stylised map panel with a location pin and address card.

Bootstrap 5 No jQuery Nov 2019 2.3K views

<section class="wdw-stage">
  <div class="container" style="max-width:1040px">
    <div class="wdw-card overflow-hidden">
      <div class="row g-0">
        <div class="col-lg-6 p-4 p-md-5">
          <span class="wdw-eyebrow">Contact</span>
          <h1 class="wdw-heading display-6 mb-2">Let's talk</h1>
          <p class="text-body-secondary mb-4">Tell us about your project and we'll reply within one business day.</p>
          <form id="contactForm" novalidate>
            <div class="form-floating mb-3"><input type="text" class="form-control" id="cName" placeholder="Name" required autocomplete="name"><label for="cName">Name</label></div>
            <div class="form-floating mb-3"><input type="email" class="form-control" id="cEmail" placeholder="Email" required autocomplete="email"><label for="cEmail">Email address</label></div>
            <div class="form-floating mb-4"><textarea class="form-control cmsg" id="cMsg" placeholder="Message" required></textarea><label for="cMsg">Message</label></div>
            <div class="d-flex flex-wrap align-items-center justify-content-between gap-3">
              <button type="submit" class="btn btn-primary rounded-pill px-4">Send message</button>
              <a href="tel:+12515469442" class="link-body-emphasis link-underline-opacity-0 fw-semibold d-inline-flex align-items-center gap-2"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.9" 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.9.4 1.8.7 2.7a2 2 0 0 1-.5 2.1L8.1 9.8a16 16 0 0 0 6 6l1.3-1.3a2 2 0 0 1 2.1-.4c.9.3 1.8.6 2.7.7a2 2 0 0 1 1.7 2z"/></svg>251 546 9442</a>
            </div>
            <div class="alert alert-success d-none mt-3 mb-0" id="contactOk" role="status">Thanks! Your message is on its way.</div>
          </form>
        </div>
        <div class="col-lg-6 map-pane position-relative" style="min-height:340px">
          <svg class="map-svg" viewBox="0 0 520 480" preserveAspectRatio="xMidYMid slice" role="img" aria-label="Map showing our San Francisco office">
            <rect width="520" height="480" class="m-land"/>
            <path class="m-water" d="M0 0h190c-30 70 20 120-10 190S130 340 170 480H0z"/>
            <path class="m-park" d="M300 70h110v70H300z"/><path class="m-park" d="M70 330h90v70H70z"/>
            <g class="m-road"><path d="M190 0c40 140 120 220 330 250"/><path d="M0 250h520" /><path d="M330 0v480"/><path d="M230 480c20-120 120-170 290-190"/><path d="M420 0v480"/><path d="M250 120h270"/></g>
            <g class="m-road2"><path d="M0 160h330"/><path d="M0 340h520"/><path d="M270 0v480"/><path d="M370 0v480"/><path d="M470 0v480"/><path d="M250 420h270"/></g>
          </svg>
          <div class="map-pin" aria-hidden="true"><span class="pulse"></span><svg width="40" height="48" viewBox="0 0 24 29" fill="var(--bs-primary)"><path d="M12 0C5.4 0 0 5.2 0 11.7 0 20 12 29 12 29s12-9 12-17.3C24 5.2 18.6 0 12 0z"/><circle cx="12" cy="11.5" r="4.5" fill="#fff"/></svg></div>
          <div class="wdw-card-sm map-card p-3 d-flex gap-3 align-items-center">
            <span class="wdw-icon"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.9" 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 class="flex-grow-1"><div class="fw-bold">San Francisco HQ</div><div class="small text-body-secondary">120 Market Street, CA 94105</div></div>
            <a class="btn btn-sm btn-outline-primary rounded-pill" href="#">Directions</a>
          </div>
        </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.