Skip to content
rw3iss Auth

UserMenu

atom @rw3iss/auth-client/preact/atoms/UserMenu framework-adapters/preact/components/atoms/UserMenu.tsx ↗

Header-level user menu — avatar trigger + dropdown with profile info and sign-out. Anchors absolute-positioned panel to the trigger; closes on outside click + Escape.

Drop into your app header alongside AuthLoading / GuestOnly so the trigger renders only when authenticated:

<ProtectedRoute fallback={Sign in}>

Usage

import { UserMenu } from '@rw3iss/auth-client/preact/atoms';
<UserMenu />

Props

NameTypeDescription
clientAuthClient
extrapreact.ComponentChildrenSlot rendered above the sign-out button — e.g. settings link.
onIdentityClick() => voidMake the identity block (name + email) interactive — e.g. link to the user’s profile. Provide `onIdentityClick` for SPA routers (called, then the menu closes) and/or `identityHref` for plain anchor navigation. When neither is set the block is static. /
identityHrefstring