Stay search-bar conventions
View .mdUse one interaction model for every stay search bar. Each selection field opens
a popover from the field: dates, guests, bedrooms, destination or group,
accommodation type, and pets. Do not replace a field with a native select or
a bare checkbox.
Shared rules
Section titled “Shared rules”-
Every selection opens a popover from its field. The popover is the same pattern on desktop and phone; keep the field value on one line on a phone.
-
There is no Done button. Clicking outside the open field and its popover, or pressing Escape, closes it. A click inside the popover, such as a counter button, keeps it open. Choosing an option in a choice popover closes it. The dates popover has Clear dates only.
A search action is the only submit action in the bar; closing a popover must never require a second confirmation button.
-
Counts use minus and plus controls. Guests is a number. Bedrooms shows
Anyat zero andN+for a minimum greater than zero. -
Hide a field when it has no real choices. For example, hide an accommodation-type field when its only value is
All types; do not show a popover with one choice. -
Keep edits as a draft until Search. On submit, write through the one stay store and the canonical stay keys using
useStayQueryandstayQueryToSearchParams. Without JavaScript, the form still submits those same keys as named inputs. -
Share one field layout and popover style across the bar. On narrow screens, values stay on one line and the popover remains usable without horizontal scrolling.
Counter popover
Section titled “Counter popover”Counters stay open while the user adjusts a value. The display is derived from the draft, and the canonical stay store is updated only by the form submit.
<FieldPopover label="Guests" value={`${draft.guests} guests`}> <Counter label="Guests" value={draft.guests} min={1} onChange={(guests) => setDraft({ ...draft, guests })} /></FieldPopover>Choice popover
Section titled “Choice popover”Choice fields close after a selection. Omit the whole field when there is no choice beyond its no-filter value.
{types.length > 1 && ( <FieldPopover label="Type" value={draft.type ?? 'Any type'}> {types.map((type) => ( <button type="button" key={type.value} onClick={() => { setDraft({ ...draft, type: type.value }); closePopover(); }} > {type.label} </button> ))} </FieldPopover>)}The stay-search-form and stay-search-bar recipes use these conventions. The canonical stay URL page explains the shared store and parameter contract.