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
npx airflib@latest add mobile-search-flow
Usage
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.
| Name | Type | Default | Description |
|---|---|---|---|
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. |
foldOnScroll | boolean | true | The 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. |
dynamicText | boolean | true | Type, hold and erase the hints of the empty field while open. |
waist | boolean | true | The notch that pinches the search, and the fields inside its search screen, between the two fields; off, plain rounded cards. |
radius | number | 20px | Corner 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
Liquid materialA material for any element: glass, frosted or solid. Glass bends the live content behind it and splits it into a thin rainbow, frosted blurs it; panes brought close flow together like drops, and stretch and settle as they move.Locate buttonA “use my location” row: its arrow rocks like a balance while your app looks, swings down and turns into a pin once found.Mobile searchA mobile search of one line, or of two that fold into a compact pill as the page scrolls, giving the content its space back. For search, booking and filter headers.Word reelOne big word on a drum: tap it and it spins, each tap turns it faster, then it slows down and lands on a word.