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.
<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>
/* Web Designer Wall library style — shared base for every Bootstrap 5 snippet.
Indigo accent, Plus Jakarta Sans, soft cards, pill buttons. Works in light and dark. */
@import url("https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap");
:root,
[data-bs-theme="light"] {
--wdw-font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
--bs-body-font-family: var(--wdw-font);
--bs-primary: #4f46e5;
--bs-primary-rgb: 79, 70, 229;
--bs-primary-text-emphasis: #3730a3;
--bs-primary-bg-subtle: #eef2ff;
--bs-primary-border-subtle: #c7d2fe;
--bs-link-color: #4f46e5;
--bs-link-color-rgb: 79, 70, 229;
--bs-link-hover-color: #4338ca;
--bs-link-hover-color-rgb: 67, 56, 202;
--bs-focus-ring-color: rgba(79, 70, 229, 0.25);
--bs-border-radius: 0.75rem;
--bs-border-radius-lg: 1rem;
--bs-border-radius-xl: 1.25rem;
--wdw-radius-card: 1.25rem;
--wdw-shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 16px 40px -16px rgba(16, 24, 40, 0.22);
--wdw-shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06), 0 4px 12px -4px rgba(16, 24, 40, 0.12);
--wdw-stage: #f5f6fb;
}
[data-bs-theme="dark"] {
--bs-primary: #818cf8;
--bs-primary-rgb: 129, 140, 248;
--bs-primary-text-emphasis: #c7d2fe;
--bs-primary-bg-subtle: rgba(129, 140, 248, 0.14);
--bs-primary-border-subtle: rgba(129, 140, 248, 0.35);
--bs-link-color: #a5b4fc;
--bs-link-color-rgb: 165, 180, 252;
--bs-link-hover-color: #c7d2fe;
--bs-link-hover-color-rgb: 199, 210, 254;
--bs-focus-ring-color: rgba(129, 140, 248, 0.35);
--wdw-shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 16px 40px -16px rgba(0, 0, 0, 0.7);
--wdw-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4), 0 4px 12px -4px rgba(0, 0, 0, 0.5);
--wdw-stage: #0f1117;
}
body { font-family: var(--wdw-font); -webkit-font-smoothing: antialiased; }
/* Bootstrap compiles its blue into these components; point them at the accent. */
.btn-primary {
--bs-btn-bg: var(--bs-primary); --bs-btn-border-color: var(--bs-primary);
--bs-btn-hover-bg: #4338ca; --bs-btn-hover-border-color: #4338ca;
--bs-btn-active-bg: #3730a3; --bs-btn-active-border-color: #3730a3;
--bs-btn-disabled-bg: var(--bs-primary); --bs-btn-disabled-border-color: var(--bs-primary);
--bs-btn-focus-shadow-rgb: var(--bs-primary-rgb);
}
[data-bs-theme="dark"] .btn-primary { --bs-btn-color: #0f1117; --bs-btn-hover-bg: #a5b4fc; --bs-btn-hover-border-color: #a5b4fc; --bs-btn-hover-color: #0f1117; --bs-btn-active-color: #0f1117; }
.btn-outline-primary {
--bs-btn-color: var(--bs-primary); --bs-btn-border-color: var(--bs-primary);
--bs-btn-hover-bg: var(--bs-primary); --bs-btn-hover-border-color: var(--bs-primary);
--bs-btn-active-bg: var(--bs-primary); --bs-btn-active-border-color: var(--bs-primary);
--bs-btn-focus-shadow-rgb: var(--bs-primary-rgb);
}
.btn { --bs-btn-font-weight: 600; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: .5rem; }
.btn-sm { min-height: 36px; }
.form-control, .form-select { min-height: 44px; border-radius: .75rem; }
.form-control:focus, .form-select:focus, .form-check-input:focus { border-color: rgba(var(--bs-primary-rgb), .6); box-shadow: 0 0 0 .25rem var(--bs-focus-ring-color); }
.form-check-input:checked { background-color: var(--bs-primary); border-color: var(--bs-primary); }
.nav-pills { --bs-nav-pills-link-active-bg: var(--bs-primary); }
.nav { --bs-nav-link-color: var(--bs-secondary-color); --bs-nav-link-hover-color: var(--bs-emphasis-color); }
.pagination { --bs-pagination-active-bg: var(--bs-primary); --bs-pagination-active-border-color: var(--bs-primary); --bs-pagination-color: var(--bs-body-color); --bs-pagination-focus-box-shadow: 0 0 0 .25rem var(--bs-focus-ring-color); }
.progress, .progress-stacked { --bs-progress-bar-bg: var(--bs-primary); }
.list-group { --bs-list-group-active-bg: var(--bs-primary); --bs-list-group-active-border-color: var(--bs-primary); }
.dropdown-menu { --bs-dropdown-link-active-bg: var(--bs-primary); border-radius: .875rem; box-shadow: var(--wdw-shadow-sm); }
.accordion { --bs-accordion-active-bg: var(--bs-primary-bg-subtle); --bs-accordion-active-color: var(--bs-primary-text-emphasis); --bs-accordion-btn-focus-box-shadow: 0 0 0 .25rem var(--bs-focus-ring-color); }
.badge { font-weight: 600; }
/* Library building blocks — use these instead of re-inventing them per snippet. */
.wdw-stage { min-height: 100vh; display: flex; align-items: center; background: var(--wdw-stage); padding-block: 3rem; }
.wdw-card { background: var(--bs-body-bg); border: 1px solid var(--bs-border-color-translucent); border-radius: var(--wdw-radius-card); box-shadow: var(--wdw-shadow); }
.wdw-card-sm { background: var(--bs-body-bg); border: 1px solid var(--bs-border-color-translucent); border-radius: 1rem; box-shadow: var(--wdw-shadow-sm); }
.wdw-aurora { position: relative; color: #fff; background: radial-gradient(60% 55% at 100% 0, #818cf8 0, transparent 70%), radial-gradient(65% 60% at 0 100%, #ec4899 0, transparent 65%), #1e1b4b; }
.wdw-eyebrow { display: inline-block; font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--bs-primary); }
.wdw-heading { font-weight: 800; letter-spacing: -.02em; color: var(--bs-emphasis-color); }
.wdw-muted { color: var(--bs-secondary-color); }
.wdw-icon { width: 2.75rem; height: 2.75rem; flex: none; display: inline-flex; align-items: center; justify-content: center; border-radius: .875rem; background: var(--bs-primary-bg-subtle); color: var(--bs-primary); }
/* Component */
.trip-hero { min-height: 100vh; display: flex; background: linear-gradient(180deg, rgba(8,15,35,.55) 0, rgba(8,15,35,.42) 45%, rgba(8,15,35,.7) 100%), url("https://images.unsplash.com/photo-1507525428034-b723cf961d3e?auto=format&fit=crop&w=1800&q=80") center / cover no-repeat; background-color: #1e3a5f; }
.trip-inner { flex: 1; }
.trip-title { letter-spacing: -.03em; text-shadow: 0 2px 24px rgba(0,0,0,.25); }
.trip-lead { max-width: 34rem; }
@media (max-width: 767.98px) { .trip-lead { margin-inline: auto; } }
.trip-badge { background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.35); backdrop-filter: blur(8px); font-weight: 600; padding: .5rem .9rem; }
.trip-form { backdrop-filter: blur(10px); }
.trip-stepper output { display: flex; align-items: center; justify-content: center; }
.trip-stepper .btn { border-color: var(--bs-border-color); color: var(--bs-body-color); }
.trip-stepper .btn:hover { background: var(--bs-tertiary-bg); }
function initTripStepper() {
var out = document.getElementById('tripQty');
if (!out) return;
var n = parseInt(out.textContent, 10) || 1;
document.querySelectorAll('#tripForm [data-step]').forEach(function (b) {
b.addEventListener('click', function () {
n = Math.min(12, Math.max(1, n + parseInt(b.dataset.step, 10)));
out.textContent = n;
});
});
}
function initTripDates() {
var from = document.getElementById('tripFrom'), to = document.getElementById('tripTo');
if (!from || !to) return;
var today = new Date().toISOString().slice(0, 10);
from.min = to.min = today;
from.addEventListener('change', function () {
to.min = from.value || today;
if (to.value && to.value < from.value) to.value = from.value;
});
}
function initTripSubmit() {
var form = document.getElementById('tripForm'), msg = document.getElementById('tripMsg');
if (!form || !msg) return;
form.addEventListener('submit', function () {
var dest = document.getElementById('tripDest').value.trim();
msg.classList.remove('d-none');
msg.textContent = dest ? 'Searching trips to ' + dest + '...' : 'Enter a destination to start your search.';
});
}
initTripStepper(); initTripDates(); initTripSubmit();
Built on Bootstrap 5.3.8 with plain JavaScript — no jQuery. Supports light and dark mode via data-bs-theme.