Skip to main content

User button

The avatar of the signed-in person, with a menu that opens the account pages and signs out.

ComponentReadyView source
Works with
ReactNext.js

Select the avatar to open the menu.

Installation​

npm install @lumoauth/react

Usage​

src/components/Header.tsx
import { UserButton } from '@lumoauth/react';

export function Header() {
return (
<header>
<Logo />
<UserButton showName afterSignOutUrl="/" />
</header>
);
}

When nobody is signed in, the component renders nothing. Pair it with SignedOut to show a sign-in button in that case.

The menu​

ItemWhat it does
Manage accountOpens the hosted account pages of your organization, where the person changes the profile, the password, passkeys and MFA.
Sign outRevokes the access token, clears the tokens in the browser, and ends the session at LumoAuth, so that the hosted sign-in page asks again.

Props​

PropTypeDescription
showNamebooleanShow the name of the person next to the avatar.
afterSignOutUrlstringWhere to go after sign-out. Defaults to the afterSignOutUrl of the provider.
appearanceAppearancePropsTheme, CSS variables and class name for this component. See Theming.