Skip to content

The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]

fix(ui): render the sidebar scrollbar with shadcn ScrollArea (#33124)

yuneng-jiang07d2a03dbfab
diff --git a/ui/litellm-dashboard/src/app/globals.css b/ui/litellm-dashboard/src/app/globals.css
index 0b555fcdd52..4589d0f528a 100644
--- a/ui/litellm-dashboard/src/app/globals.css
+++ b/ui/litellm-dashboard/src/app/globals.css
@@ -11,6 +11,25 @@
@custom-variant dark (&:where(.dark, .dark *));
+/* shadcn Base UI primitives reference these variants; upstream omits them (shadcn-ui/ui#9196) */
+@custom-variant data-open (&:where([data-state="open"], [data-open]:not([data-open="false"])));
+@custom-variant data-closed (&:where([data-state="closed"], [data-closed]:not([data-closed="false"])));
+@custom-variant data-checked (&:where([data-state="checked"], [data-checked]:not([data-checked="false"])));
+@custom-variant data-unchecked (&:where([data-state="unchecked"], [data-unchecked]:not([data-unchecked="false"])));
+@custom-variant data-selected (&:where([data-selected="true"]));
+@custom-variant data-disabled (&:where([data-disabled="true"], [data-disabled]:not([data-disabled="false"])));
+@custom-variant data-active (&:where([data-state="active"], [data-active]:not([data-active="false"])));
+@custom-variant data-horizontal (&:where([data-orientation="horizontal"]));
+@custom-variant data-vertical (&:where([data-orientation="vertical"]));
+
+@utility no-scrollbar {
+ -ms-overflow-style: none;
+ scrollbar-width: none;
+ &::-webkit-scrollbar {
+ display: none;
+ }
+}
+
:root {
--radius: 0.5rem;
--background: oklch(1 0 0);
diff --git a/ui/litellm-dashboard/src/components/leftnav.tsx b/ui/litellm-dashboard/src/components/leftnav.tsx
index c24cebe7e7d..92dd3c849ef 100644
--- a/ui/litellm-dashboard/src/components/leftnav.tsx
+++ b/ui/litellm-dashboard/src/components/leftnav.tsx
@@ -7,9 +7,9 @@ import { getProxyBaseUrl } from "@/components/networking";
import { useTheme } from "@/contexts/ThemeContext";
import { Badge } from "@/components/ui/badge";
import { Button } from "@/components/ui/button";
+import { ScrollArea } from "@/components/ui/scroll-area";
import {
Sidebar,
- SidebarContent,
SidebarFooter,
SidebarGroup,
SidebarGroupLabel,
@@ -608,15 +608,17 @@ const Sidebar_: React.FC<SidebarProps> = ({
</div>
</SidebarHeader>
- <SidebarContent>
- {visibleGroups.map((group, gi) => (
- <SidebarGroup key={group.groupLabel}>
- {gi > 0 && <SidebarSeparator className="hidden group-data-[collapsed=true]/sidebar:block" />}
- <SidebarGroupLabel>{group.groupLabel}</SidebarGroupLabel>
- <SidebarMenu>{group.items.map((item) => renderItem(item))}</SidebarMenu>
- </SidebarGroup>
- ))}
- </SidebarContent>
+ <ScrollArea className="min-h-0 flex-1">
+ <nav className="flex flex-col gap-0.5 px-3 pb-3">
+ {visibleGroups.map((group, gi) => (
+ <SidebarGroup key={group.groupLabel}>
+ {gi > 0 && <SidebarSeparator className="hidden group-data-[collapsed=true]/sidebar:block" />}
+ <SidebarGroupLabel>{group.groupLabel}</SidebarGroupLabel>
+ <SidebarMenu>{group.items.map((item) => renderItem(item))}</SidebarMenu>
+ </SidebarGroup>
+ ))}
+ </nav>
+ </ScrollArea>
<SidebarFooter>
{isAdminRole(userRole) && (