Snippets Forms

Bootstrap 5 Hotel Search Form with Dates and Guests

A hotel search card with a stay-type selector, destination, date range and guest fields, and extra filter checkboxes.

Bootstrap 5 No jQuery May 2019 3.5K views

<section class="wdw-stage wdw-aurora">
  <div class="container w-100" style="max-width:1060px">
    <div class="text-center mb-4 mb-lg-5">
      <span class="wdw-eyebrow text-white opacity-75">Stays</span>
      <h1 class="display-5 fw-bold text-white mt-2 mb-0" style="letter-spacing:-.02em">Find your next hotel</h1>
    </div>
    <form class="wdw-card p-4 p-lg-5" id="hsForm">
      <div class="d-flex d-sm-inline-flex gap-1 p-1 bg-body-tertiary rounded-pill mb-4 hs-seg" role="radiogroup" aria-label="Stay type">
        <input type="radio" class="btn-check" name="type" id="t1" value="Hotels" checked><label class="btn btn-outline-primary flex-fill rounded-pill border-0 px-3 px-sm-4" for="t1">Hotels</label>
        <input type="radio" class="btn-check" name="type" id="t2" value="Apartments"><label class="btn btn-outline-primary flex-fill rounded-pill border-0 px-3 px-sm-4" for="t2">Apartments</label>
        <input type="radio" class="btn-check" name="type" id="t3" value="Resorts"><label class="btn btn-outline-primary flex-fill rounded-pill border-0 px-3 px-sm-4" for="t3">Resorts</label>
      </div>
      <div class="row g-3 align-items-end">
        <div class="col-md-6 col-lg-4 order-md-1">
          <label for="hsWhere" class="form-label small fw-semibold">Destination</label>
          <div class="position-relative">
            <svg class="hs-ico text-primary" 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="M12 21s7-6.2 7-11.5A7 7 0 0 0 5 9.5C5 14.8 12 21 12 21z"/><circle cx="12" cy="9.5" r="2.5"/></svg>
            <input id="hsWhere" class="form-control ps-5" placeholder="City or hotel name" required>
          </div>
        </div>
        <div class="col-lg-5 order-md-3 order-lg-2">
          <div class="d-flex flex-wrap align-items-end gap-2 hs-dates">
            <div class="hs-date"><label for="hsIn" class="form-label small fw-semibold">Check-in</label><input id="hsIn" type="date" class="form-control" required></div>
            <span class="badge rounded-pill bg-primary-subtle text-primary-emphasis hs-nights" id="hsNights" aria-live="polite">3 nights</span>
            <div class="hs-date"><label for="hsOut" class="form-label small fw-semibold">Check-out</label><input id="hsOut" type="date" class="form-control" required></div>
          </div>
        </div>
        <div class="col-md-6 col-lg-3 order-md-2 order-lg-3"><label for="hsGuests" class="form-label small fw-semibold">Guests</label>
          <select id="hsGuests" class="form-select"><option>1 adult</option><option selected>2 adults</option><option>2 adults, 1 child</option><option>2 adults, 2 children</option><option>4 adults</option></select></div>
      </div>
      <div class="d-flex flex-column flex-md-row align-items-md-center justify-content-between gap-3 mt-4 pt-4 border-top">
        <div class="row row-cols-2 row-cols-md-auto g-2" role="group" aria-label="Filters">
          <div class="col"><input class="btn-check" type="checkbox" id="o1" checked><label class="btn btn-outline-primary btn-sm rounded-pill w-100 px-3" for="o1">Free cancellation</label></div>
          <div class="col"><input class="btn-check" type="checkbox" id="o2"><label class="btn btn-outline-primary btn-sm rounded-pill w-100 px-3" for="o2">Breakfast included</label></div>
          <div class="col"><input class="btn-check" type="checkbox" id="o3"><label class="btn btn-outline-primary btn-sm rounded-pill w-100 px-3" for="o3">Pet friendly</label></div>
        </div>
        <button type="submit" class="btn btn-primary rounded-pill px-5">Search</button>
      </div>
    </form>
    <div class="wdw-card-sm d-flex align-items-center gap-3 p-3 mt-3 mx-auto" style="max-width:640px" id="hsResultCard" hidden>
      <span class="wdw-icon"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M5 12l5 5 9-10"/></svg></span>
      <p class="mb-0 fw-semibold text-body-emphasis" id="hsResult" aria-live="polite"></p>
    </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.