suiss/uim · Block

Inbox Categories

A mail inbox sorted into Primary, Transactions, Updates and Promotions, with a reader and swipe actions on each row.

Inbox Categories 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
Inbox Categories on iOS in light mode

A mail screen built on SplitView: the list column shows a ToggleGroup of four categories with unread dots, and rows with an Avatar, sender and preview; the detail column shows the selected message. On wide screens the list and reader sit side by side; on phones the reader opens as its own column. Swipe a row with SwipeActions to archive it, or swipe fully to delete. The reader has Reply, Star, Archive and Delete buttons, and Reply opens a Textarea to write a response.

Installation

$ pnpm dlx @esuiss/uim@latest add inbox-categories

The CLI also adds what it builds on: Avatar, Button, Icon, Screen, Split View, Swipe Actions, Text, Textarea, Toggle Group.

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: Avatar, Button, Icon, Screen, Split View, Swipe Actions, Text, Textarea, Toggle Group.

  2. Copy the source into components/blocks/inbox-categories.tsx:

uniwind/components/blocks/inbox-categories.tsx
import { cn } from "cn"
import {
  ArchiveIcon,
  ArrowBendUpLeftIcon,
  BellIcon,
  CreditCardIcon,
  type Icon as PhosphorIcon,
  StarIcon,
  TagIcon,
  TrashIcon,
  UsersIcon,
} from "phosphor-react-native"
import * as React from "react"
import { useWindowDimensions, View } from "react-native"
import { FadeInDown, ReduceMotion } from "react-native-reanimated"
import {
  1. Update the import paths to match your project.

Usage

import { InboxCategories } from "@/components/blocks/inbox-categories"
<InboxCategories />

Replace INITIAL_MAIL with your messages and adjust CATEGORIES if you sort mail differently. Wire onCategoryChange, onReply, onStarChange, onArchive and onDelete to your mail service; the screen updates its own state either way.