suiss/uim · Block

Empty Offline

An offline state with a retry button that shows a spinner and then a sample album grid once connected.

Empty Offline 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 Offline on iOS in light mode

Composes Screen, Empty, Button, Spinner, Icon and Text. Try Again shows a loading state for a moment and then switches to the online content, which has a Disconnect link back to the offline state.

Installation

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

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

Manual

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

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

uniwind/components/blocks/empty-offline.tsx
import { WifiSlashIcon } from "phosphor-react-native"
import * as React from "react"
import { Image, Pressable, ScrollView, 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,
  EmptyMedia,
  EmptyTitle,
} from "@/components/ui/empty"
import { Icon } from "@/components/ui/icon"
import { Screen } from "@/components/ui/screen"
  1. Update the import paths to match your project.

Usage

import { EmptyOffline } from "@/components/blocks/empty-offline"
<EmptyOffline />

Replace ALBUMS with your content and the timed retry with a real connectivity check. The component takes no props.