From 28a6cec77c350a3a7de86c8fc24a2b94c72b482e Mon Sep 17 00:00:00 2001 From: Cole McIntosh <82463175+colesmcintosh@users.noreply.github.com> Date: Thu, 10 Jul 2025 19:14:00 -0600 Subject: [PATCH] feat: improve user dropdown UI with premium badge and cleaner layout (#12502) - Add premium/standard badge with crown icon next to user ID - Remove colons and improve visual hierarchy with icons - Add tooltips for user status (Premium User / Upgrade message) - Enhance spacing and typography for better readability - Update dropdown styling with proper hover states --- ui/litellm-dashboard/src/app/globals.css | 28 ++++++++ .../src/components/navbar.tsx | 71 +++++++++++++++---- 2 files changed, 87 insertions(+), 12 deletions(-) diff --git a/ui/litellm-dashboard/src/app/globals.css b/ui/litellm-dashboard/src/app/globals.css index 677ff05b86..8b9aa9e670 100644 --- a/ui/litellm-dashboard/src/app/globals.css +++ b/ui/litellm-dashboard/src/app/globals.css @@ -42,3 +42,31 @@ body { .custom-border { border: 1px solid var(--neutral-border); } + +/* Custom dropdown styles */ +.ant-dropdown-menu-item { + padding: 0 !important; +} + +.ant-dropdown-menu-item > div { + transition: all 0.2s ease; +} + +/* Don't apply hover to user info section */ +.ant-dropdown-menu-item[data-menu-id$="user-info"]:hover { + background-color: transparent !important; + cursor: default; +} + +.ant-dropdown-menu-item[data-menu-id$="user-info"] > div { + cursor: default; +} + +.ant-dropdown-menu { + padding: 4px !important; + min-width: 280px !important; +} + +.ant-dropdown-menu-item-divider { + margin: 4px 0; +} diff --git a/ui/litellm-dashboard/src/components/navbar.tsx b/ui/litellm-dashboard/src/components/navbar.tsx index 80c48dbdd4..dc7defb8e5 100644 --- a/ui/litellm-dashboard/src/components/navbar.tsx +++ b/ui/litellm-dashboard/src/components/navbar.tsx @@ -1,12 +1,17 @@ import Link from "next/link"; import React, { useState, useEffect } from "react"; import type { MenuProps } from "antd"; -import { Dropdown } from "antd"; +import { Dropdown, Tooltip } from "antd"; import { getProxyBaseUrl, Organization } from "@/components/networking"; import { defaultOrg } from "@/components/common_components/default_org"; import { UserOutlined, - LogoutOutlined + LogoutOutlined, + LoginOutlined, + BgColorsOutlined, + CrownOutlined, + MailOutlined, + SafetyOutlined } from '@ant-design/icons'; import { clearTokenCookies } from "@/utils/cookieUtils"; import { fetchProxySettings } from "@/utils/proxyUtils"; @@ -59,19 +64,55 @@ const Navbar: React.FC = ({ const userItems: MenuProps["items"] = [ { - key: "1", + key: "user-info", label: ( -
-

Role: {userRole}

-

Email: {userEmail || "Unknown"}

-

{userID}

-

Premium User: {String(premiumUser)}

+
+
+
+ + {userID} +
+ {premiumUser ? ( + +
+ + Premium +
+
+ ) : ( + +
+ + Standard +
+
+ )} +
+
+
+ + Role + {userRole} +
+
+ + Email + + {userEmail || "Unknown"} + +
+
), }, { - key: "2", - label:

Logout

, + key: "logout", + label: ( +
+ + Logout +
+ ), } ]; @@ -105,11 +146,17 @@ const Navbar: React.FC = ({