suiss/uim · Block

Chat Thread

A one-to-one chat thread with a contact header, message bubbles, double-tap hearts and a photo attachment.

Chat Thread 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
Chat Thread on iOS in light mode

Composes Screen, Avatar, Message, Bubble with BubbleReactions, MessageScroller, Attachment, InputGroup, Button and BottomBar. Double-tapping a bubble toggles a heart, the attach button adds a sample photo preview that can be removed before sending, and each sent message gets a sample reply after a typing indicator.

Installation

$ pnpm dlx @esuiss/uim@latest add chat-thread

The CLI also adds what it builds on: Attachment, Avatar, Bottom Bar, Bubble, Button, Icon, Input Group, Message, Message Scroller, Screen, 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: Attachment, Avatar, Bottom Bar, Bubble, Button, Icon, Input Group, Message, Message Scroller, Screen, Text.

  2. Copy the source into components/blocks/chat-thread.tsx:

uniwind/components/blocks/chat-thread.tsx
import {
  ArrowUpIcon,
  CaretRightIcon,
  HeartIcon,
  PlusIcon,
  XIcon,
} from "phosphor-react-native"
import * as React from "react"
import { I18nManager, Image, Pressable, View } from "react-native"
import {
  cancelAnimation,
  Easing,
  FadeInDown,
  ReduceMotion,
  useAnimatedStyle,
  useSharedValue,
  1. Update the import paths to match your project.

Usage

import { ChatThread } from "@/components/blocks/chat-thread"
<ChatThread />

Replace OPENING, REPLIES and PHOTO with your messages and attachment source. Wire onSend, onAttach, onOpenContact and onLikeChange to your messaging backend.