suiss/ui ยท Block
Users Invite
An invite form that collects several email addresses as chips, assigns a role, and lists pending invitations.
Users Invite 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.
An invite form that turns typed email addresses into removable chips, assigns a role and optionally sends a welcome email, with pending invitations listed below. Sending shows a toast and moves the addresses to the pending list, where each can be resent or cancelled. It sits in a Sidebar with admin navigation that opens as a sheet from the trigger on mobile. Use it for team invites or sharing access with several people at once.
Replace the initial pending list with invitations from your API, and edit roles. Addresses are committed on Enter, comma, space or blur, and only valid, unique ones are added. Call your invitation API in place of the local send, resend and cancel handlers.
Each chip's remove button names its address, and the summary line is announced as chips change.
Installation
Works in any project with a components.json. See Installation for the one-line registry setup. Or use the suiss/ui CLI:
Usage
Web preview
Emails become Chips as you type, and Backspace in an empty Input removes the last one. A Picker sets the role, a Switch toggles the welcome email, and the send Button adds the invites to the pending list. Pending invitations can be resent or cancelled, and sending or resending shows a toast through Toaster. The admin TabBar switches sections.
Replace ROLES and the initial pending invites with your data. Use onInvite, onResend, onCancelInvite and onNavigate to call your API.
Installation
- Install the following dependencies:
-
Add the pieces it builds on: Button, Chip, Header, Icon, Input, Item, Keyboard Scroll View, Picker, Screen, Switch, Tab Bar, Text, Toast.
-
Copy the animated view into
components/ui/animated-view.tsx:
- Copy and paste the following code into
components/blocks/users-invite.tsx:
- Update the import paths to match your project setup.
- Install the following dependencies:
-
Add the pieces it builds on: Button, Chip, Header, Icon, Input, Item, Keyboard Scroll View, Picker, Screen, Switch, Tab Bar, Text, Toast.
-
Copy the animated view into
components/ui/animated-view.tsx:
- Copy and paste the following code into
components/blocks/users-invite.tsx:
- Update the import paths to match your project setup.
- Install the following dependencies:
-
Add the pieces it builds on: Button, Chip, Header, Icon, Input, Item, Keyboard Scroll View, Picker, Screen, Switch, Tab Bar, Text, Toast.
-
Copy the animated view into
components/ui/animated-view.tsx:
- Copy and paste the following code into
components/blocks/users-invite.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.