Notification Menu

A comprehensive notification and user menu component with workspace switching.

Preview

Usage

import { NotificationMenu } from "@/components/docs/notification"

export default function App() {
  return (
    <div className="flex justify-end p-4 min-h-[400px]">
      <NotificationMenu
        avatarSrc="/img.png"
        userLabel="John Doe"
        userSubLabel="john@example.com"
        menuItems={[
          { id: "profile", label: "Profile" },
          { id: "settings", label: "Settings" },
        ]}
        workspaces={[
          { id: "ws1", label: "Personal" },
          { id: "ws2", label: "Team" },
        ]}
        onLogout={() => console.log("Logout")}
      />
    </div>
  )
}

API

PropTypeDescription
avatarSrcstringURL of the user's avatar image.
userLabelstringMain text label (e.g., user name).
userSubLabelstringSecondary text label (e.g., email).
menuItemsNotificationMenuItem[]Array of menu items to display.
workspacesNotificationWorkspaceItem[]Optional array of workspaces.
onCreateWorkspace() => voidCallback for creating a new workspace.
onLogout() => voidCallback for the logout action.
openbooleanControlled open state.
onOpenChange(open: boolean) => voidCallback for open state changes.