Mobile search flow

The whole of search on a phone: one line, two that fold as you scroll, or two asked step by step. Opens into a fullscreen or sheet search. Fills from your location or picks for you. Loading, error and offline covered.

Install

Terminal
npx airflib@latest add mobile-search-flow

Usage

TSX
import { MobileSearchFlow } from "@/components/airflib/flows/mobile-search-flow";

<MobileSearchFlow
  tone="light"
  fieldCount="steps"
  presentation="fullscreen"
  dismiss="close"
  foldOnScroll={true}
  fold="left"
  dynamicText={true}
  waist={true}
  radius={20}
/>

API

Its main settings, read from the code: each prop's type and default. The prompt lists every prop.

NameTypeDefaultDescription
tone"light" | "dark""light"Light or dark paint for the search and its search screen.
fieldCount"one" | "two" | "steps""steps"one: one line outside (never folded, no waist), one field inside. two: two lines, both fields inside at once. steps: two lines outside, inside one field at a time, a pick moving on to the next.
presentation"fullscreen" | "sheet""fullscreen"How the search screen comes: rises as a sheet, or grows out of the search.
dismiss"back" | "close""close"The way out of a fullscreen search screen with one field in view (one, steps): a back chevron, or a cross that empties the field first. Either keeps what was picked.
foldOnScrollbooleantrueThe search folds into a pill as the page scrolls; off, it stays open.
fold"center" | "left""left"Folded pill: center summary, or left with the open icon.
dynamicTextbooleantrueType, hold and erase the hints of the empty field while open.
waistbooleantrueThe notch that pinches the search, and the fields inside its search screen, between the two fields; off, plain rounded cards.
radiusnumber20pxCorner radius of every part, in pixels. From 0 to 32px.

Sound

The sounds in the catalog are the site's. The block comes silent, with a place for your own.

Uses