NativeSearchBar
SearchBar — text input with cancel + clear + optional voice trigger. Use as the search affordance for lists and result screens. iOS-style "Cancel" button slides in only when the input is focused and clears focus on press. The clear "✕" appears whenever there's a value. Voice support is opt-in: pass `onVoicePress` to render the voice button. The actual STT integration is the consumer's responsibility (e.g., expo-speech-recognition); this primitive only renders the trigger affordance.
packages/ui-native/src/components/search-bar.tsx
Import
Subpath export:
@marktiderman/genesis-ui-nativeimport { NativeSearchBar } from "@marktiderman/genesis-ui-native";Components
Auto-generated from TypeScript source via
react-docgen-typescript.NativeSearchBar
| Prop | Type | Default | Description |
|---|---|---|---|
| onChange* | (value: string) => void | — | |
| value* | string | — | |
| cancelLabel | string | Cancel | Cancel button label. Default "Cancel". |
| className | string | — | |
| onSubmit | ((value: string) => void) | — | Submit handler (return key on the keyboard). |
| onVoicePress | (() => void) | — | When provided, renders a microphone trigger. |
| placeholder | string | Search | |
| placeholderTextColor | string | — | Color used for the placeholder text. Defaults to a token-aware muted value that matches NativeWind's `text-muted-foreground` resolution. Override per-call when an alternate brand demands a different shade. |
| showCancel | boolean | true | Show the "Cancel" button when focused. Default true. |
| testID | string | — |