Applies to every preview on the site.
Installation
One command copies the source into your app — you own the code and can change anything.
After you add the file, import it like any local component:
import { SearchBar } from "@/components/ui/search-bar";Or add it with the CLI (installs any missing peers):
Usage
useKit(). Wrap your app in <KitProvider accent="#6366f1" radius={14}> to re-skin every component at once.Like this? There's a lot more in Pro Pro
12 full screens built from the same kit — install them the same way.
Props
| Prop | Type | Default |
|---|---|---|
| variant Outlined pill, iOS grey field, or a round icon that expands into a field. | "default" | "filled" | "minimal" | "default" |
| size 34 / 44 / 56pt tall; font, icons, padding and radius scale too. | "sm" | "md" | "lg" | "md" |
| value / defaultValue / onChangeText Controlled or uncontrolled query. | string | — |
| loading Crossfades the magnifier into a spinning arc. | boolean | false |
| showCancel Slide a Cancel button in while searching. | boolean | true (false for minimal) |
| cancelLabel Cancel button text. | string | labels.cancel |
| onCancel After Cancel clears the query and blurs. | () => void | — |
| onClear After the clear button empties the query. | () => void | — |
| align Minimal only: where the collapsed icon rests. | "left" | "right" | "left" |
| suggestions Shown in a dropdown panel while focused; the matching text is bolded. | { key, label, hint?, icon?: 'recent' | 'trending' | 'search' }[] | — |
| onSelectSuggestion Called after a suggestion is picked (the query is set to its label). | (item) => void | — |
| filterSuggestions Filter suggestions by the query. Turn off to filter them yourself. | boolean | true |
| maxSuggestions Most rows shown in the panel. | number | 6 |
| trailing Rendered inside the field on the right, e.g. a filter or mic button. | ReactNode | — |
| accent Focus ring, caret and Cancel colour. | string | theme accent |
| style Style for the root view around the field, cancel button and suggestions. | StyleProp<ViewStyle> | — |
| className Tailwind classes on the root when using NativeWind or Uniwind. Prefer style for StyleSheet overrides. | string | — |
| …TextInputProps placeholder, onSubmitEditing, autoFocus, … |
Customization
You own the source file — tune appearance with props (no fork required for most tweaks). For brand-wide colours and radius, wrap your app in KitProvider; for one-off looks, use the style props below.
Design theme
Open Design theme on the live preview — accent, corner radius and font update every variant instantly (same as KitProvider in your app).
Variants
Pick the Variants chip above the preview, or set variant=… — "default" | "filled" | "minimal".
Style props
React Native style and typed slots like fieldStyle, plus optional root className when you use NativeWind or Uniwind (cnProps from kit).
- variant
- "default" | "filled" | "minimal" · default "default"Outlined pill, iOS grey field, or a round icon that expands into a field.
- size
- "sm" | "md" | "lg" · default "md"34 / 44 / 56pt tall; font, icons, padding and radius scale too.
- accent
- string · default theme accentFocus ring, caret and Cancel colour.
- style
- StyleProp<ViewStyle>Style for the root view around the field, cancel button and suggestions.
- className
- stringTailwind classes on the root when using NativeWind or Uniwind. Prefer style for StyleSheet overrides.
Map tokens from your design system on Bring your design system or read Theming for KitProvider and NativeWind / Uniwind setup.
Behaviour & accessibility
- Motion
- On focus a halo glows and the magnifier pops; Cancel slides in as the field springs narrower and the clear button scales in. loading swaps the magnifier for a spinning arc.
- Touch
- The 'minimal' variant rests as a round icon and expands into a full field when tapped. Picking a suggestion fills the query and dismisses the keyboard.
- Screen readers
- The input has the search role, labelled by its placeholder. 'Clear search', Cancel and each suggestion are labelled buttons.
- Web
- The browser outline is replaced by the border and halo, and the suggestion panel stays open a beat after blur so clicks land.
Source
FAQ
How do I make a search input in React Native?
npx @expokit/cli@latest add search-bar in your Expo or React Native project and it copies a ready-made search input into your app as plain TypeScript you can edit. It works on iOS, Android and web, and in Expo Go.Does Search Bar work in Expo Go?
react-native-svg) are all included in Expo Go.How do I add Search Bar to my Expo app?
npx @expokit/cli@latest add search-bar in your project. The CLI copies the component's source into your app and installs react-native-svg, so the code is yours to change.Is Search Bar free?
Can I change how Search Bar looks?
useKit(), so wrapping your app in <KitProvider accent radius> re-skins it with every other ExpoKit component. The code lives in your project, so you can also edit anything directly.