User Menu

Avatar-trigger popover whose menu rows are supplied by the caller via an `items` prop. Designed for top-bar slots where space is tight. Opens downward and right-aligned by default; closes on outside-click and Escape.

Open down
Open up

Add to your project

One command adds this component to your project.

1

Run the following command. New project? Run npx shadcn@latest init first to set up Tailwind and path aliases.

npx shadcn@latest add @aicanvas/andromeda-user-menu

Props

Every prop this component accepts. Any other prop is forwarded to the underlying element.

UserMenuItem

PropTypeDefaultDescription
idstring-Stable key for the row, falling back to its array index.
labelstring-Text shown on the menu item, rendered uppercase.
iconReact.ComponentType<{ size?: number, weight?: string }>-Icon component rendered before the label.
onSelect() => void-Handler called when the item is chosen; the menu closes after.
destructiveboolean-Renders the item in the destructive red color.
type'separator'-Set to 'separator' to render a divider instead of an item.

UserMenu

PropTypeDefaultDescription
namereqstring-Display name; passed to Avatar for the initial fallback.
srcstring-Avatar image URL.
status'online'|'caution'|'fault'|'offline'-Presence state; passed to Avatar for the status dot.
avatarSize'sm'|'md'|'lg''md'Size of the trigger avatar.
itemsreqUserMenuItem[]-The menu rows to render, including separators.
placement'top'|'bottom''bottom'Whether the panel opens below or above the trigger.
align'start'|'end''end'Which trigger edge the panel aligns to horizontally.
defaultOpenbooleanfalseRender the menu pre-opened (showcases / docs). Outside-click and Escape still dismiss it.
staticOpenbooleanfalseRender pre-opened AND pinned; outside-click / Escape do not dismiss it. For showcases / docs where several popovers are shown open at once and one must not close the others.
ariaLabelstring'User menu'Accessible label for the trigger button and menu panel.
classNamestring-Class name applied to the wrapper element.
styleReact.CSSProperties-Inline styles merged onto the wrapper element.

More Andromeda components