Lemma User Menu
lemma/lemma-user-menuFreeBlock
A user avatar with initials fallback and dropdown menu for app headers, showing user info, configurable menu items, online indicator, and sign-out action.
Install it
npx shadcn@latest add https://raw.githubusercontent.com/lemma-work/lemma-platform/main/lemma-typescript/public/r/lemma-user-menu.jsonSource
1"use client"23import * as React from "react"4import { LogOut, User, ChevronDown } from "lucide-react"5import {6 DropdownMenu,7 DropdownMenuContent,8 DropdownMenuGroup,9 DropdownMenuItem,10 DropdownMenuLabel,11 DropdownMenuSeparator,12 DropdownMenuTrigger,13} from "@/components/lemma/ui/dropdown-menu"14import { cn } from "@/components/lemma/lib/utils"1516export type LemmaUserMenuAppearance = "default" | "borderless" | "minimal" | "contained"17export type LemmaUserMenuDensity = "compact" | "comfortable" | "spacious"18export type LemmaUserMenuRadius = "none" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "full"1920export interface LemmaUserMenuItem {21 label: string22 href?: string23 onClick?: () => void24 icon?: React.ReactNode25 variant?: "default" | "destructive"26}2728export interface LemmaUserMenuProps {29 userName?: string30 userEmail?: string31 userAvatarUrl?: string32 isOnline?: boolean33 menuItems?: LemmaUserMenuItem[]34 onSignOut?: () => void35 appearance?: LemmaUserMenuAppearance36 density?: LemmaUserMenuDensity37 radius?: LemmaUserMenuRadius38 className?: string39}4041const RADIUS_MAP: Record<LemmaUserMenuRadius, Record<string, string>> = {42 none: { surface: "rounded-none", control: "rounded-none", pill: "rounded-none", overlay: "rounded-none" },43 sm: { surface: "rounded-sm", control: "rounded-sm", pill: "rounded-full", overlay: "rounded-sm" },44 md: { surface: "rounded-md", control: "rounded-md", pill: "rounded-full", overlay: "rounded-md" },45 lg: { surface: "rounded-lg", control: "rounded-md", pill: "rounded-full", overlay: "rounded-lg" },46 xl: { surface: "rounded-xl", control: "rounded-lg", pill: "rounded-full", overlay: "rounded-xl" },47 "2xl": { surface: "rounded-2xl", control: "rounded-xl", pill: "rounded-full", overlay: "rounded-2xl" },48 "3xl": { surface: "rounded-3xl", control: "rounded-2xl", pill: "rounded-full", overlay: "rounded-3xl" },49 full: { surface: "rounded-3xl", control: "rounded-full", pill: "rounded-full", overlay: "rounded-3xl" },50}5152function userMenuRadiusClassName(53 radius: LemmaUserMenuRadius,54 kind: "surface" | "control" | "pill" | "overlay",55): string {56 return RADIUS_MAP[radius]?.[kind] ?? RADIUS_MAP.lg[kind]57}5859function triggerVariant(appearance: LemmaUserMenuAppearance) {60 return appearance === "minimal" || appearance === "borderless" ? "ghost" : "outline"61}6263function avatarShellClassName(appearance: LemmaUserMenuAppearance) {64 return cn(65// … truncated
What it pulls in
npm packages
Other registry items
Files it writes
More from lemma
All 20 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Lemma Action Surfacelemma-action-surface | lemma | Blocks | Free | 4 deps | |
| Lemma Activity Feedlemma-activity-feed | lemma | Blocks | Free | 4 deps · 3 files | |
| Lemma Agent Conversation Experiencelemma-assistant-experience | lemma | Blocks | Free | 7 deps · 3 files | |
| Lemma Breadcrumbslemma-breadcrumbs | lemma | Blocks | Free | 3 deps | |
| Lemma Commentslemma-comments | lemma | Blocks | Free | 4 deps · 3 files | |
| Lemma Detail Panellemma-detail-panel | lemma | Blocks | Free | 4 deps · 7 files | |
| Lemma Document Workspacelemma-document-workspace | lemma | Blocks | Free | 6 deps | |
| Lemma File Browserlemma-file-browser | lemma | Blocks | Free | 4 deps |
