Snippets Form

Bootstrap 5 Travel Booking Form over Hero Image

A full-screen photo hero with a headline and a booking bar for destination, dates and traveller count, finished with a search button.

Bootstrap 5 No jQuery Jun 2019 2.5K views

<section class="trip-hero">
  <div class="container position-relative py-4 py-lg-5 d-flex flex-column trip-inner" style="max-width:1080px">
    <div class="d-flex justify-content-between align-items-center text-white">
      <a href="#" class="d-flex align-items-center gap-2 text-white text-decoration-none fw-bold fs-5"><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="M17.8 19.2 16 11l3.5-3.5C21 6 21.500 4 21 3c-1-.5-3 0-4.500 1.500L13 8 4.800 6.200c-.5-.1-.9.100-1.100.500l-.3.500c-.2.500-.1 1 .3 1.300L9 12l-2 3H4l-1 1 3 2 2 3 1-1v-3l3-2 3.500 5.300c.3.400.8.500 1.300.300l.5-.2c.4-.3.600-.700.500-1.200z"/></svg>Wayfarer</a>
      <nav class="d-none d-md-flex gap-4 small fw-semibold" aria-label="Main"><a class="text-white text-decoration-none opacity-75" href="#">Stays</a><a class="text-white text-decoration-none opacity-75" href="#">Flights</a><a class="text-white text-decoration-none" href="#">Packages</a><a class="text-white text-decoration-none opacity-75" href="#">Offers</a></nav>
    </div>
    <div class="my-auto py-5 text-white text-center text-md-start">
      <span class="badge rounded-pill trip-badge mb-3">Summer escapes from $449</span>
      <h1 class="display-4 fw-bold trip-title mb-3">Find your next<br>sunrise.</h1>
      <p class="fs-5 opacity-75 mb-0 trip-lead">Hand-picked beaches, islands and city breaks with free cancellation on most bookings.</p>
    </div>
    <form class="trip-form wdw-card p-3 p-lg-4" id="tripForm" onsubmit="return false">
      <div class="row g-3 align-items-end">
        <div class="col-12 col-lg-3">
          <label for="tripDest" class="form-label small fw-semibold d-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="M20 10c0 6-8 12-8 12s-8-6-8-12a8 8 0 0 1 16 0z"/><circle cx="12" cy="10" r="3"/></svg>Destination</label>
          <input type="text" id="tripDest" class="form-control" placeholder="e.g. Maui, Hawaii" autocomplete="off">
        </div>
        <div class="col-6 col-lg-2">
          <label for="tripFrom" class="form-label small fw-semibold">Check in</label>
          <input type="date" id="tripFrom" class="form-control">
        </div>
        <div class="col-6 col-lg-2">
          <label for="tripTo" class="form-label small fw-semibold">Check out</label>
          <input type="date" id="tripTo" class="form-control">
        </div>
        <div class="col-6 col-lg-2">
          <span class="form-label small fw-semibold d-block" id="travLabel">Travellers</span>
          <div class="input-group trip-stepper" role="group" aria-labelledby="travLabel">
            <button class="btn btn-outline-secondary px-0" type="button" data-step="-1" aria-label="Fewer travellers" style="width:44px">−</button>
            <output class="form-control text-center fw-semibold px-0" id="tripQty" aria-live="polite">2</output>
            <button class="btn btn-outline-secondary px-0" type="button" data-step="1" aria-label="More travellers" style="width:44px">+</button>
          </div>
        </div>
        <div class="col-6 col-lg-3"><button type="submit" class="btn btn-primary rounded-pill w-100">Search trips <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="M5 12h14M13 6l6 6-6 6"/></svg></button></div>
      </div>
      <p class="small mb-0 mt-3 text-body-secondary d-none" id="tripMsg" role="status"></p>
    </form>
  </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.