suiss/uim · Block

Empty Search

A search screen with a field, live suggestions and a no-results state with suggested searches.

Empty Search is an open-source mobile screen from suiss/uim for React Native and Expo, with SwiftUI and Jetpack Compose versions built from the same design tokens. The @esuiss/uim CLI copies its source into your project, so you own the code.

iOS
Empty Search on iOS in light mode

Composes Screen, Input, Empty, Button, Icon and Text. Typing filters the suggestions list, the clear button empties the field and refocuses it, and when nothing matches the screen shows a no-results message with suggestion buttons that fill in the query.

Installation

$ pnpm dlx @esuiss/uim@latest add empty-search

The CLI also adds what it builds on: Button, Empty, Icon, Input, Screen, Text.

Manual

  1. Install the dependencies:
npx expo install cn phosphor-react-native react-native-reanimated react-native-svg react-native-worklets
  1. Add the pieces it builds on: Button, Empty, Icon, Input, Screen, Text.

  2. Copy the source into components/blocks/empty-search.tsx:

uniwind/components/blocks/empty-search.tsx
import { cn } from "cn"
import { MagnifyingGlassIcon, XIcon } from "phosphor-react-native"
import * as React from "react"
import { Pressable, ScrollView, type TextInput, View } from "react-native"
import { FadeInDown, ReduceMotion } from "react-native-reanimated"
import { AnimatedView } from "@/components/ui/animated-view"
import { Button } from "@/components/ui/button"
import {
  Empty,
  EmptyContent,
  EmptyDescription,
  EmptyHeader,
  EmptyTitle,
} from "@/components/ui/empty"
import { Icon } from "@/components/ui/icon"
import { Input } from "@/components/ui/input"
  1. Update the import paths to match your project.

Usage

import { EmptySearch } from "@/components/blocks/empty-search"
<EmptySearch />

Replace SUGGESTIONS and the prefix matching with results from your search service. The component takes no props.