CruiseSearchBar
Canonical cruise search bar composing two LocationAutocomplete fields (departure + destination), DateRangePicker, and GuestRoomSelector (reused for cabins). Presentational only — fires onSearch(value) on valid submit.
Validation
Both departure and destination are required. Dates are optional; if a start date is set the end date must also be provided and can't precede it. Errors appear inline below the bar and clear as the user corrects each field.
Click Search without filling in departure and destination to see inline validation.
Pre-filled value
Pass a fully populated CruiseSearchBarValue to render the bar in a pre-filled state — including multiple cabins with children ages.
Props reference
| Prop | Type | Default | Description |
|---|---|---|---|
| value | CruiseSearchBarValue | required | Controlled value { departure, destination, dateFrom, dateTo, guests } |
| onSearch | (value: CruiseSearchBarValue) => void | required | Called on valid submit — parent owns navigation |
| departureSuggestions | LocationSuggestion[] | — | Suggestion list for the departure autocomplete |
| fetchDepartureSuggestions | (query: string) => void | — | Called (debounced) when user types in departure |
| destinationSuggestions | LocationSuggestion[] | — | Suggestion list for the destination autocomplete |
| fetchDestinationSuggestions | (query: string) => void | — | Called (debounced) when user types in destination |
| maxRooms / maxAdults / maxChildren / maxChildAge | number | 8/8/4/17 | Passed through to GuestRoomSelector |
| departurePlaceholder | string | "Departing from" | Placeholder for the departure input |
| destinationPlaceholder | string | "Where to?" | Placeholder for the destination input |
| datePlaceholder | string | "Anytime" | Placeholder for the date range picker |
| guestPlaceholder | string | "Cabins & guests" | Placeholder for the guest selector |
| submitLabel | string | "Search" | Label on the submit button |
| disabled | boolean | false | Disables the submit button |
| className | string | — | Extra classes on the root wrapper |