Skip to main content

UserProfileView

The UserProfileView renders a comprehensive user profile interface that displays user information and provides account management options.

The UserProfileView renders a comprehensive user profile interface that displays user information and provides account management options. It includes personal information, security settings, account switching, and sign-out functionality.

Important

The UserProfileView only appears when there is a current user.

  • Name
    clerkTheme
    Type
    ClerkTheme?
    Description

    The theme to apply to the UserProfileView. This will override any theme applied to the UserProfileView's parent view, or configured in the Clerk global object.

  • Name
    customRows
    Type
    List<UserProfileCustomRow>
    Description

    Custom rows to display on the profile account screen.

  • Name
    customDestination
    Type
    (@Composable (String) -> Unit)?
    Description

    Destination builder for custom rows. The destination receives the tapped row's routeKey. Custom rows are ignored when this is null.

  • Name
    onAddAccount
    Type
    (() -> Unit)?
    Description

    Called when the user selects the add account action. Use this to host the add account auth flow outside the profile view.

  • Name
    onDismiss
    Type
    (() -> Unit)?
    Description

    Called when the user profile view is dismissed. When omitted, dismissal falls back to the system back dispatcher.

  • Name
    isDismissible
    Type
    Boolean
    Description

    Whether the view shows a top-right close affordance that dismisses the profile. Defaults to true.

The following example shows how to use the UserProfileView in your Android app.

Fullscreen profile view

Use UserProfileView as a fullscreen view when you want to dedicate the entire screen to profile management.

import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.lifecycle.compose.collectAsStateWithLifecycle
import com.clerk.api.Clerk
import com.clerk.ui.userprofile.UserProfileView

@Composable
fun ProfileView() {
  val user by Clerk.userFlow.collectAsStateWithLifecycle()
  if (user != null) {
    UserProfileView()
  }
}

Non-dismissible profile view

Use isDismissible = false when the profile view is the required fullscreen experience for the current route.

import com.clerk.ui.userprofile.UserProfileView

UserProfileView(isDismissible = false)

Customization

To learn how to customize Clerk views, see the dedicated guide.

If Clerk's prebuilt views don't meet your specific needs or if you require more control over the logic, you can rebuild the existing Clerk flows using the Clerk API. For more information, see the custom flow guides.

Feedback

What did you think of this content?

Last updated on