suiss/ui · Block
Chat Thread
A single message thread inside a phone frame, with heart reactions and simulated replies.
Chat Thread is an open-source block from suiss/ui for React, React Native, SwiftUI and Jetpack Compose. The @esuiss/ui CLI copies its source into your project, so you own the code.
A single conversation in a phone frame, with a contact header, message bubbles, heart reactions and a composer. Double-clicking a bubble, or pressing Enter on it, toggles a heart. The frame appears from small tablets up while the smallest screens show the thread edge to edge, and on desktop a caption sits beside the phone. It works for showing off a chat feature on a marketing page or as the base of a one-to-one chat view.
Installation
CLI
Works in any project with a components.json. See Installation for the one-line registry setup. Or use the suiss/ui CLI:
Manual
- Install the dependencies:
-
Add the pieces it builds on: Avatar, Bubble, Button, Input, Message, Message Scroller.
-
Copy the source into
components/blocks/chat-thread.tsx:
- Update the import paths to match your project.
Usage
Replace opening with your initial messages, each with an id, sender, text and an optional liked flag. The send function fakes a typing indicator and a reply from replies, so wire it to your messaging backend instead. Update the contact name and initials, and point the #contact link at a real profile.
Notes
Each bubble is a button whose label includes the message and how to toggle the heart, so reactions work from the keyboard.

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
The CLI also adds what it builds on: Attachment, Avatar, Bottom Bar, Bubble, Button, Icon, Input Group, Message, Message Scroller, Screen, Text. On React Native it also adds the animated view components/ui/animated-view.tsx.
Manual
- Install the dependencies:
-
Add the pieces it builds on: Attachment, Avatar, Bottom Bar, Bubble, Button, Icon, Input Group, Message, Message Scroller, Screen, Text, and the animated view
components/ui/animated-view.tsxfrom the next step. -
Copy the animated view into
components/ui/animated-view.tsx:
- Copy the source into
components/blocks/chat-thread.tsx:
- Update the import paths to match your project.
- Install the dependencies:
-
Add the pieces it builds on: Attachment, Avatar, Bottom Bar, Bubble, Button, Icon, Input Group, Message, Message Scroller, Screen, Text, and the animated view
components/ui/animated-view.tsxfrom the next step. -
Copy the animated view into
components/ui/animated-view.tsx:
- Copy the source into
components/blocks/chat-thread.tsx:
- Update the import paths to match your project.
- Install the dependencies:
-
Add the pieces it builds on: Attachment, Avatar, Bottom Bar, Bubble, Button, Icon, Input Group, Message, Message Scroller, Screen, Text, and the animated view
components/ui/animated-view.tsxfrom the next step. -
Copy the animated view into
components/ui/animated-view.tsx:
- Copy the source into
components/blocks/chat-thread.tsx:
- Update the import paths to match your project.
-
Target iOS 17 or later.
-
Add the Swift package to your app:
- Copy the theme files every view uses:
- Copy the source and every file it uses:
- Add the files to your app target.
- Set
minSdkto 24 or higher and add the dependencies:
- Copy the theme files every view uses:
- Copy the source and every file it uses:
- Update the
com.esuiss.uipackage names to match your project.
Usage
Replace OPENING, REPLIES and PHOTO with your messages and attachment source. Wire onSend, onAttach, onOpenContact and onLikeChange to your messaging backend.
