suiss/ui ยท Block
Settings Account
An account settings page with a profile sidebar and a Sign-In and Security section of editable cards.
Settings Account 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 account settings page with a profile header and a sidebar of sections. Only Sign-In and Security is filled in: email and phone cards that expand into an inline edit form, a Passkeys switch, a two-factor row and a confirmation after each save, while the other sections show a placeholder. It uses a Sidebar that slides off canvas. Use it as the frame for any account or profile settings.
Load the email, phone and profile details from the signed-in user, and replace the onSave handler with your account API. Add content for the remaining sections listed in items. The profile name, email and initials in the header are hard-coded.
Collapsed edit forms are inert, focus moves to the input when a card opens, and save confirmations are announced.
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
The main page shows an Avatar and name above an inset ItemGroup of account sections; tapping one pushes it into the same Header with a back button. The Sign-In & Security page has cards for email and phone that open an inline Input with Save and Cancel, a passkeys Switch, and a confirmation that appears after saving. Other sections show a placeholder.
Replace ITEMS and the initial email and phone values with your account data. Use onSave, which receives the field and new value, to persist edits.
Installation
- Install the following dependencies:
-
Add the pieces it builds on: Avatar, Button, Header, Icon, Input, Item, Screen, Switch, Text.
-
Copy the animated view into
components/ui/animated-view.tsx:
- Copy and paste the following code into
components/blocks/settings-account.tsx:
- Update the import paths to match your project setup.
- Install the following dependencies:
-
Add the pieces it builds on: Avatar, Button, Header, Icon, Input, Item, Screen, Switch, Text.
-
Copy the animated view into
components/ui/animated-view.tsx:
- Copy and paste the following code into
components/blocks/settings-account.tsx:
- Update the import paths to match your project setup.
- Install the following dependencies:
-
Add the pieces it builds on: Avatar, Button, Header, Icon, Input, Item, Screen, Switch, Text.
-
Copy the animated view into
components/ui/animated-view.tsx:
- Copy and paste the following code into
components/blocks/settings-account.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.