Snippets Form

Bootstrap 5 Newsletter Subscription Form

A newsletter subscription panel on a brand gradient with a pill email field, inline validation and a confirmation message.

Bootstrap 5 No jQuery Mar 2020 2.2K views

<section class="wdw-stage">
  <div class="container" style="max-width:860px">
    <div class="wdw-aurora rounded-5 p-4 p-md-5 text-center overflow-hidden">
      <span class="sub-badge d-inline-flex align-items-center gap-2 rounded-pill px-3 py-1 small fw-semibold mb-3">
        <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"><rect x="3" y="5" width="18" height="14" rx="3"/><path d="M3 8l9 6 9-6"/></svg>
        Weekly newsletter
      </span>
      <h2 class="display-6 fw-bold mb-3" style="letter-spacing:-.02em">Get design and code tips in your inbox</h2>
      <p class="mx-auto mb-4 sub-lead" style="max-width:520px">One short email every Friday with new components, tutorials and tools. Join 12,000 developers. Unsubscribe anytime.</p>
      <form class="sub-form mx-auto" id="subForm" novalidate>
        <div class="sub-field d-flex flex-column flex-sm-row gap-2 p-2 rounded-5">
          <label for="subEmail" class="visually-hidden">Email address</label>
          <input type="email" id="subEmail" class="form-control border-0 bg-transparent text-white" placeholder="[email protected]" autocomplete="email" required aria-describedby="subMsg">
          <button type="submit" class="btn btn-light rounded-pill px-4 text-nowrap">Subscribe</button>
        </div>
        <p class="small mt-3 mb-0 sub-msg" id="subMsg" role="status" aria-live="polite">No spam. Just the good stuff.</p>
      </form>
    </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.