suiss/ui ยท Block
Inbox Mail
A three-column mail client with mailboxes, a searchable message list, and a message reader with reply.
Inbox Mail 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 three-pane mail client: mailboxes on the left, a searchable message list in the middle and the open message with a reply box on the right. On small screens the panes collapse into a single view with a back button. Start from it for any inbox-style screen, such as support tickets or notifications.
Replace initialMail with your messages, each with a sender, subject, body, time, avatar hue and unread and starred flags, and mailboxes with your folders. Only Starred actually filters the list, so load each folder from your mail backend. Archive and Delete both remove the message, the reply form only clears on submit, and New message has no handler.
Search runs in the browser over sender, subject and body, so move it server-side for real mailboxes. The reply box receives focus when it opens.
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, Button, Input Group, Split View, Textarea.
-
Copy and paste the following code into your project.
- Update the import paths to match your project setup.
Usage
Web preview
A three-column mail screen built on SplitView: a sidebar of mailboxes (Inbox, Starred, Sent, Archive, Trash), a message list with a search field made from InputGroup, and a reader. On phones each column opens in turn. Rows use Avatar and support SwipeActions to archive or delete, and searching filters by sender, subject and body. The reader has Reply, Star, Archive and Delete buttons, and Reply opens a Textarea.
Replace INITIAL_MAIL with your messages and MAILBOXES with your folders. Wire onMailboxChange, onNewMessage, onReply, onStarChange, onArchive and onDelete to your mail service.
Installation
The CLI also adds what it builds on: Avatar, Button, Icon, Input Group, Screen, Split View, Swipe Actions, Text, Textarea. It also adds the animated view components/ui/animated-view.tsx.
- Install the following dependencies:
-
Add the pieces it builds on: Avatar, Button, Icon, Input Group, Screen, Split View, Swipe Actions, Text, Textarea.
-
Copy the animated view into
components/ui/animated-view.tsx:
- Copy and paste the following code into
components/blocks/inbox-mail.tsx:
- Update the import paths to match your project setup.
- Install the following dependencies:
-
Add the pieces it builds on: Avatar, Button, Icon, Input Group, Screen, Split View, Swipe Actions, Text, Textarea.
-
Copy the animated view into
components/ui/animated-view.tsx:
- Copy and paste the following code into
components/blocks/inbox-mail.tsx:
- Update the import paths to match your project setup.
- Install the following dependencies:
-
Add the pieces it builds on: Avatar, Button, Icon, Input Group, Screen, Split View, Swipe Actions, Text, Textarea.
-
Copy the animated view into
components/ui/animated-view.tsx:
- Copy and paste the following code into
components/blocks/inbox-mail.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.