@methane-ui/auth~10.1 KB brotli (kit + Lit)~3.2 KB marginalAuthenticated user profile menu trigger with positioned overlay popover, role badge, and roving menu items.
When NOT to use: Use a lightweight @methane-ui/css layout class instead of a custom element when static CSS suffices.
Multi-Framework Playground & Snippets
Properties & Attributes
| Property | Attribute | Type | Default | Description |
|---|
open | open | boolean | false | Whether the profile dropdown menu is open. |
name | name | string | "" | Authenticated user display name. |
email | email | string | "" | Authenticated user email address. |
avatarSrc | avatar-src | string | "" | Avatar image URL rendered inside <mth-avatar>. |
userRole | user-role | string | "" | Optional user role badge shown in menu header. |
items | — | ReadonlyArray<unknown> | — | Menu action entries rendered inside the overlay. |
placement | placement | unknown | "bottom-end" | Preferred overlay placement relative to the trigger. |
offset | offset | number | 8 | Gap in pixels between trigger and menu surface. |
disabled | disabled | boolean | false | Disables opening the profile menu. |
Events
| Event | Detail Type | Description |
|---|
mth-open | void | Emitted before opening; cancelable. |
mth-after-open | void | Emitted after menu opens. |
mth-close | { reason: string } | Emitted before closing. |
mth-after-close | { reason: string } | Emitted after menu closes. |
mth-select | { id: string; label: string; item: unknown } | Emitted when a menu action is selected. |
APG Keyboard Matrix
| Key | Direction | When | Expected Behavior |
|---|
| Escape | both | Menu overlay is open | Closes menu and restores focus to trigger |
| ArrowDown | both | Menu item is focused | Moves focus to next menu item |
Accessibility Checklist
| Category | Requirement | Verified By |
|---|
| aria | All aria-* IDREFs resolve within the same DOM root (ADR-003). | scanSameRootAria |
| focus | Focus ownership matches focusModel="host". | lint-plugin & spec-compiler |
| contrast | Renders legible borders, focus outlines, and selection indicators under forced-colors: active. | Playwright forced-colors matrix |
| keyboard | Implements all 2 APG keyboard transitions across LTR/RTL. | mth-profile-menu.spec.test.ts |
| states | Exposes ElementInternals CustomStateSet flags: :state(open), :state(disabled). | Conformance suite |
| i18n | Routes 3 UI/ARIA strings through @methane-ui/core i18n catalog. | Locale context test |