Account menu
Place it in a signed-in application's header so users can access account settings and sign out.
Clerk · Component
UserButton renders an account menu for signed-in users, including account management and sign-out. With multi-session enabled, it also supports switching between accounts.
UserButton renders a familiar account control for signed-in users. Selecting it opens a menu for account management and sign-out; with multi-session enabled, users can also switch between accounts. The account-management view can be configured through userProfileProps.
<UserButton />Renders a user button component; no documented return value is specified.
import { UserButton } from '@clerk/nextjs'
export default function Header() {
return (
<header>
<UserButton />
</header>
)
}Render this component in a signed-in area to provide account management and sign-out controls.
Place it in a signed-in application's header so users can access account settings and sign out.
Enable multi-session to let users move between multiple signed-in accounts.
Add product-specific commands or navigation destinations to the account menu.
UserButton is a user-facing account menu. Selecting it exposes account-management and sign-out actions, and it can also support instant account switching when multi-session is enabled.
Follow-up: How would you configure the account-management experience? Pass configuration through the userProfileProps prop.
The component opens UserProfile when the user chooses Manage account. The userProfileProps prop is the configuration point for that UserProfile experience.
Follow-up: What happens if the application needs a different profile presentation? Configure the profile behavior through userProfileProps rather than changing the button's core role.
With multi-session enabled, UserButton lets a user sign into multiple accounts and switch between them without a full page reload. This makes it suitable for applications where users operate more than one account.
Follow-up: What prerequisite controls whether switching is available? Multi-session must be enabled for the account-switching behavior described by the documentation.
UserProfileuserProfilePropsmulti-sessioncustom actionscustom links