suiss/ui ยท Block
Users Detail
A user directory with a member list beside a detail pane for profile, sessions, and security settings.
Users Detail 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 user directory with members on the left and the selected user's profile, sessions and security settings on the right, switched with tabs. Admins can change a role, sign out sessions, toggle security options and send a password reset link. It combines Sidebar navigation with a SplitView, so on mobile the list and detail show one at a time. Use it for team members, customers or any record with tabbed details.
Replace users, roles and initialSessions with your data. In the sample every user shares one session list, and Department and Joined are hard-coded, so load these per user. Connect the role change, session sign-outs, security switches and reset button to your user management API.
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, Item, Select, Sidebar, Split View, Switch, Toggle Group.
-
Copy and paste the following code into your project.
- Update the import paths to match your project setup.
Usage
Web preview
A SplitView lists users with an Avatar and status, and the detail pane shows the selected user's header and a ToggleGroup for Profile, Sessions and Security. Profile lists details with a role Picker, Sessions lets you sign out one device or all others, and Security has Switch rows and a password reset Button. The admin TabBar switches sections.
Replace USERS, ROLES and INITIAL_SESSIONS with your data. Use onRoleChange, onSignOut, onSignOutAll, onSecurityChange, onSendPasswordReset and onNavigate to call your API.
Installation
- Install the following dependencies:
-
Add the pieces it builds on: Avatar, Button, Icon, Item, Picker, Screen, Split View, Switch, Tab Bar, Text, Toggle Group.
-
Copy the animated view into
components/ui/animated-view.tsx:
- Copy and paste the following code into
components/blocks/users-detail.tsx:
- Update the import paths to match your project setup.
- Install the following dependencies:
-
Add the pieces it builds on: Avatar, Button, Icon, Item, Picker, Screen, Split View, Switch, Tab Bar, Text, Toggle Group.
-
Copy the animated view into
components/ui/animated-view.tsx:
- Copy and paste the following code into
components/blocks/users-detail.tsx:
- Update the import paths to match your project setup.
- Install the following dependencies:
-
Add the pieces it builds on: Avatar, Button, Icon, Item, Picker, Screen, Split View, Switch, Tab Bar, Text, Toggle Group.
-
Copy the animated view into
components/ui/animated-view.tsx:
- Copy and paste the following code into
components/blocks/users-detail.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.