Mobile › Navigation

SearchField

A search input. Use it on its own, or pass search to a NavBar with variant="search".

Installation

npx expo install plankui-mobile react-native-safe-area-context expo-haptics

Usage

import { SearchField } from "plankui-mobile";

const [q, setQ] = useState("");

<SearchField value={q} onChangeText={setQ} placeholder="Search places" />

iOS and Android

iOS: A grey rounded field with a magnifier; a Cancel button slides in while it has focus.

Android: Material 3 search bar: a full pill on the surface colour.

API reference

PropTypeDefaultDescription
valuestringThe query.
onChangeText(v: string) => voidCalled on every keystroke.
placeholderstring"Search"Hint text.
...TextInputPropsTextInputProps–Any other React Native TextInput prop, such as onSubmitEditing.