User button
The avatar of the signed-in person, with a menu that opens the account pages and signs out.
Select the avatar to open the menu.
Installation
- npm
- pnpm
- Yarn
- Bun
npm install @lumoauth/react
pnpm add @lumoauth/react
yarn add @lumoauth/react
bun add @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
| Item | What it does |
|---|---|
| Manage account | Opens the hosted account pages of your organization, where the person changes the profile, the password, passkeys and MFA. |
| Sign out | Revokes 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
| Prop | Type | Description |
|---|---|---|
showName | boolean | Show the name of the person next to the avatar. |
afterSignOutUrl | string | Where to go after sign-out. Defaults to the afterSignOutUrl of the provider. |
appearance | AppearanceProps | Theme, CSS variables and class name for this component. See Theming. |