Mobile search

A 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.

Install

Terminal
npx airflib@latest add mobile-search

Usage

TSX
import { MobileSearch } from "@/components/airflib/components/mobile-search";

<MobileSearch
  tone="light"
  fieldCount="two"
  foldOnScroll={true}
  fold="left"
  dynamicText={true}
  waist={true}
  radius={24}
/>

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/dark paint for this control only.
fieldCount"one" | "two""two"One line (it never folds and has no waist), or two for a search with two answers (from and to, what and where).
foldOnScrollbooleantrueTwo lines fold into a pill as the page scrolls. Off, they stay open; state still sets it. One line never folds.
fold"center" | "left""left"Folded pill: center summary, or left with morphing open icon.
dynamicTextbooleantrueType, hold and erase the hints of the empty field while open.
waistbooleantrueThe notch that pinches the card between its two fields; one line has none. Off, a plain rounded card; give Search screen's waist the same.
radiusnumber24pxCorner radius in px; the notched side caps at ¼ card height. Left out, the --mobile-search-radius token applies (24px unless you set it). From 0 to 32px.

Sound

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

Used in