suiss/uim · Block

Empty Bag

An empty bag state with sign-in and shopping buttons and a horizontal row of recommended products.

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

Composes Screen, Empty, Button, Icon and Text. Adding a recommended product with its plus button increments a badge on the bag icon and changes the title and primary button to a checkout prompt.

Installation

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

The CLI also adds what it builds on: Button, Empty, Icon, 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, Screen, Text.

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

uniwind/components/blocks/empty-bag.tsx
import { cn } from "cn"
import { CheckIcon, HandbagIcon, PlusIcon } from "phosphor-react-native"
import * as React from "react"
import { Image, ScrollView, View } from "react-native"
import { ReduceMotion, ZoomIn } 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"
  1. Update the import paths to match your project.

Usage

import { EmptyBag } from "@/components/blocks/empty-bag"
<EmptyBag />

Replace RECOMMENDED with your products. The component takes no props, so wire the Sign In, Check Out and Continue Shopping buttons to your own navigation.