Methane@methane-ui/*
CSS LayoutsComponentsSkillsTheme BuilderGitHub
← All Components

<mth-profile-menu>

@methane-ui/auth~10.1 KB brotli (kit + Lit)~3.2 KB marginal

Authenticated 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.

Live Interactive Preview

Interactive StageLive Custom Element · <mth-profile-menu> (@methane-ui/auth)
Ready · interact with <mth-profile-menu>, or toggle Theme, Direction (LTR/RTL), or props above.

Multi-Framework Playground & Snippets

<script type="module" src="@methane-ui/auth/profile-menu"></script>
<mth-profile-menu placement="bottom-end" offset="8"></mth-profile-menu>

Properties & Attributes

PropertyAttributeTypeDefaultDescription
openopenbooleanfalseWhether the profile dropdown menu is open.
namenamestring""Authenticated user display name.
emailemailstring""Authenticated user email address.
avatarSrcavatar-srcstring""Avatar image URL rendered inside <mth-avatar>.
userRoleuser-rolestring""Optional user role badge shown in menu header.
items—ReadonlyArray<unknown>—Menu action entries rendered inside the overlay.
placementplacementunknown"bottom-end"Preferred overlay placement relative to the trigger.
offsetoffsetnumber8Gap in pixels between trigger and menu surface.
disableddisabledbooleanfalseDisables opening the profile menu.

Events

EventDetail TypeDescription
mth-openvoidEmitted before opening; cancelable.
mth-after-openvoidEmitted 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

KeyDirectionWhenExpected Behavior
EscapebothMenu overlay is openCloses menu and restores focus to trigger
ArrowDownbothMenu item is focusedMoves focus to next menu item

Accessibility Checklist

CategoryRequirementVerified By
ariaAll aria-* IDREFs resolve within the same DOM root (ADR-003).scanSameRootAria
focusFocus ownership matches focusModel="host".lint-plugin & spec-compiler
contrastRenders legible borders, focus outlines, and selection indicators under forced-colors: active.Playwright forced-colors matrix
keyboardImplements all 2 APG keyboard transitions across LTR/RTL.mth-profile-menu.spec.test.ts
statesExposes ElementInternals CustomStateSet flags: :state(open), :state(disabled).Conformance suite
i18nRoutes 3 UI/ARIA strings through @methane-ui/core i18n catalog.Locale context test