YYonda UI Docs

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

PropTypeDefaultDescription
valueCruiseSearchBarValuerequiredControlled value { departure, destination, dateFrom, dateTo, guests }
onSearch(value: CruiseSearchBarValue) => voidrequiredCalled on valid submit — parent owns navigation
departureSuggestionsLocationSuggestion[]—Suggestion list for the departure autocomplete
fetchDepartureSuggestions(query: string) => void—Called (debounced) when user types in departure
destinationSuggestionsLocationSuggestion[]—Suggestion list for the destination autocomplete
fetchDestinationSuggestions(query: string) => void—Called (debounced) when user types in destination
maxRooms / maxAdults / maxChildren / maxChildAgenumber8/8/4/17Passed through to GuestRoomSelector
departurePlaceholderstring"Departing from"Placeholder for the departure input
destinationPlaceholderstring"Where to?"Placeholder for the destination input
datePlaceholderstring"Anytime"Placeholder for the date range picker
guestPlaceholderstring"Cabins & guests"Placeholder for the guest selector
submitLabelstring"Search"Label on the submit button
disabledbooleanfalseDisables the submit button
classNamestring—Extra classes on the root wrapper