Skip to main content

<UserProfile />

Cloud has the newest features. Some may not be in a release yet; the newest release is Identity & Access Management 7.3.0.

The UserProfile component displays the authenticated user's profile information in a structured and styled format. It automatically retrieves user data from the WSO2 Identity Platform authentication context if not provided, and supports profile editing with error handling.

Overview​

The UserProfile component shows user details such as display name, email, username, and other available profile information from WSO2 Identity Platform. It supports both read-only and editable modes, and can be shown as a card, popup, or inline. Profile updates are handled with built-in error feedback.

Usage​

You can use the UserProfile in several ways: with default behavior, explicit user data, or custom layout and fallback.

Basic Usage​

Show the current user's profile using data from WSO2 Identity Platform context.

UserProfile Example
import { UserProfile } from '@asgardeo/nextjs'

<UserProfile />

With Explicit User Data​

Provide a specific user object to display:

Explicit User
<UserProfile user={specificUser} />

With Card Layout and Custom Fallback​

Display the profile in a card layout and show fallback content if not signed in:

Card Layout & Fallback
<UserProfile
cardLayout={true}
fallback={<div>Please sign in to view your profile</div>}
/>

In Popup Mode​

Show the profile as a popup dialog:

Popup Mode
<UserProfile mode="popup" open={isOpen} onOpenChange={setIsOpen} />

Props​

PropTypeRequiredDescription
userany❌User object to display (defaults to WSO2 Identity Platform user)
cardLayoutboolean❌Show profile in a card layout
fallbackReactNode❌Content to show when no user is signed in
mode'inline' or 'popup'❌Display mode for the profile (inline or popup)
openboolean❌Whether the popup is open (for mode="popup")
onOpenChange(open: boolean) => void❌Callback when popup open state changes
onUpdate(payload: any) => Promise<void>❌Callback after profile update
attributeMappingobject❌Map custom profile fields (e.g. firstName, picture)
editableboolean❌Allow editing profile fields

Was this page helpful?