# Glass Search Bar — React Native component for Expo

> A floating glass search pill that swells on focus as a cancel button splits off.

iOS 26 floating search pill on Liquid Glass. The pill swells a touch on focus, a clear button pops in with text, and an optional round glass cancel button (or a Cancel capsule) splits off beside it — grouped, so on iOS 26 the two melt together as it springs in. Leading / trailing slots fit a custom icon or a mic button. Real Liquid Glass on iOS 26, blur or frosted glass everywhere else.

- Docs: https://expokit.in/docs/components/glass-search-bar
- Tier: Pro (ExpoKit Pro plan)
- Also called: liquid glass search bar, blur search bar, iOS 26 search bar
- Category: Glass
- Platforms: iOS, Android, web
- Expo Go: yes, no development build needed
- npm dependencies: expo-glass-effect, expo-blur, react-native-svg
- Uses ExpoKit items: kit, glass
- Variants: Default, With Cancel, Light

## Installation

This component is part of ExpoKit Pro. With a Pro plan, log the CLI in once and add it like any other item:

```bash
npx @expokit/cli@latest login
```

Plans: https://expokit.in/pricing

## Props

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `value / defaultValue / onChangeText` | `string` | — | Controlled or uncontrolled query; clear and cancel report ''. |
| `placeholder` | `string` | `labels.search` | Placeholder, also the field's accessibility label. |
| `onSubmit` | `(text: string) => void` | — | Called with the query when the keyboard's search key is pressed. |
| `showCancel` | `boolean` | `false` | A glass cancel button springs in beside the pill while focused or holding text. |
| `cancelLabel` | `string` | `— (round ✕)` | Text for the cancel button, e.g. "Cancel"; without it the button is a round ✕. |
| `onCancel` | `() => void` | — | After cancel clears the query and dismisses the keyboard. |
| `leading` | `ReactNode` | `magnifier` | Replaces the magnifier at the start of the pill. |
| `trailing` | `ReactNode` | — | Inside the pill at the end, e.g. a mic button. |
| `autoFocus` | `boolean` | `false` | Focus the field on mount. |
| `scheme` | `'light' \| 'dark'` | `kit theme` | Force light or dark glass and ink, e.g. 'dark' over a photo. |
| `size` | `'md' \| 'lg'` | `'md'` | 44 / 52pt tall; font, icons and padding scale too. |
| `style` | `StyleProp<ViewStyle>` | — | Row holding the pill and the cancel button. |
| `className` | `string` | — | Tailwind classes on the root when using NativeWind or Uniwind. Prefer style for StyleSheet overrides. |
| `…TextInputProps` | `` | — | editable, returnKeyType, onFocus, onBlur, onSubmitEditing, … (ref forwards to the TextInput). |

## Behaviour & accessibility

- **Motion**: The pill swells a touch on focus and a clear button pops in once there is text. With showCancel, a glass cancel button springs in beside it while searching.
- **Reduced motion**: The pill no longer swells, and the clear and cancel buttons fade in with a short timing instead of a spring.
- **Keyboard**: The return key reads Search and calls onSubmit with the query. Cancel clears the text and dismisses the keyboard.
- **Screen readers**: The field has the search role and is labelled by its placeholder. The clear and cancel buttons read "Clear search" and cancelLabel (or "Cancel search").
- **Platforms**: Real Liquid Glass on iOS 26, where the pill and cancel button melt together. Blur or frosted glass everywhere else.

## FAQ

### How do I make a liquid glass search bar in React Native?

Use ExpoKit's Glass Search Bar, a Pro component: with ExpoKit Pro, the ExpoKit CLI copies a ready-made liquid glass search bar into your Expo or React Native app as plain TypeScript you can edit. It works on iOS, Android and web, and in Expo Go.

### Does Glass Search Bar work in Expo Go?

Yes. Glass Search Bar runs in Expo Go on iOS and Android with no development build — its packages (expo-glass-effect, expo-blur, react-native-svg) are all included in Expo Go.

### How do I add Glass Search Bar to my Expo app?

With ExpoKit Pro, add it with the ExpoKit CLI: it copies the component's source into your app and installs expo-glass-effect, expo-blur, react-native-svg, so the code is yours to change. The install command is on this page for Pro members.

### Is Glass Search Bar free?

Glass Search Bar is part of ExpoKit Pro. With a Pro plan, log the CLI in once and it installs the full source into your app.

## More

- Live preview, variants and code: https://expokit.in/docs/components/glass-search-bar
- Every ExpoKit component, screen, template and chart: https://expokit.in/llms.txt
- Install commands and props for every free component: https://expokit.in/llms-full.txt
- Pricing: https://expokit.in/pricing
