suiss/ui ยท Block
Chat Conversations
A messaging app layout with a conversation list beside the selected thread and a message composer.
Chat Conversations 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 messaging app with conversations on the left, the open thread on the right and a composer whose send button appears once you type. On mobile only one pane shows at a time, starting with the conversation list, and a back button returns to it. Built on SplitView and MessageScroller, it is a starting point for direct messages, team chat or customer conversations.
Replace the threads array; each thread has a name, avatar hue, time and lines written as strings prefixed with me: or them:. The send function fakes a typing indicator and a canned reply from replies, so replace it with your messaging backend. The New message, attachment, video call and details buttons have no handlers.
Typing status is announced, and icon-only buttons are labeled. The composer input uses its placeholder as its accessible name, so keep the placeholder descriptive.
Installation
Works in any project with a components.json. See Installation for the one-line registry setup. Or use the suiss/ui CLI:
- Install the following dependencies:
-
Add the pieces it builds on: Avatar, Bubble, Button, Input, Message, Message Scroller, Split View.
-
Copy and paste the following code into your project.
- Update the import paths to match your project setup.
Usage
Web preview
Composes Screen, Header, SwipeActions from the interactions, Avatar, Message, Bubble, MessageScroller, InputGroup, Button and BottomBar. Tapping a row opens the thread with a back button, video call and details actions, and a composer. Sending a message shows a typing indicator followed by a sample reply. Swiping a row reveals a Delete action.
Replace THREADS and REPLIES with your conversations and drop the canned replies. Wire onSend, onNewMessage, onAttach, onVideoCall, onDetails and onDelete to your messaging backend.
Installation
The CLI also adds what it builds on: Avatar, Bottom Bar, Bubble, Button, Header, Icon, Input Group, Message, Message Scroller, Screen, Swipe Actions, Text. It also adds the animated view components/ui/animated-view.tsx.
- Install the following dependencies:
-
Add the pieces it builds on: Avatar, Bottom Bar, Bubble, Button, Header, Icon, Input Group, Message, Message Scroller, Screen, Swipe Actions, Text.
-
Copy the animated view into
components/ui/animated-view.tsx:
- Copy and paste the following code into
components/blocks/chat-conversations.tsx:
- Update the import paths to match your project setup.
- Install the following dependencies:
-
Add the pieces it builds on: Avatar, Bottom Bar, Bubble, Button, Header, Icon, Input Group, Message, Message Scroller, Screen, Swipe Actions, Text.
-
Copy the animated view into
components/ui/animated-view.tsx:
- Copy and paste the following code into
components/blocks/chat-conversations.tsx:
- Update the import paths to match your project setup.
- Install the following dependencies:
-
Add the pieces it builds on: Avatar, Bottom Bar, Bubble, Button, Header, Icon, Input Group, Message, Message Scroller, Screen, Swipe Actions, Text.
-
Copy the animated view into
components/ui/animated-view.tsx:
- Copy and paste the following code into
components/blocks/chat-conversations.tsx:
- Update the import paths to match your project setup.
-
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.
- Apply the Compose compiler plugin, enable Compose, set
compileSdkto 37 or higher andminSdkto 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.