From 4d82b4a84ae8f43d7df5945bc88c2b9040371f8a Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Thu, 23 Apr 2026 07:58:02 +0000 Subject: [PATCH] feat(ui): migrate api-reference section to shadcn - APIReferenceView: @tremor TabGroup/Tab/Text/Grid \u2192 shadcn Tabs + plain Tailwind layout. Replace tremor-content-strong with semantic foreground tokens. - CodeBlock: replace bg-gray-100/border-gray-200/text-gray-600 with bg-muted/border-border/text-muted-foreground. Syntax-highlighter inline customStyle preserved (it owns the editor surface and isn't theme-aware). - DocLink: replace border-zinc-200/bg-white/text-zinc-700/ring-blue-500 with semantic tokens (border-border/bg-background/text-foreground/ ring-ring). Use cn() from @/lib/utils. Gates: TS \u2713 | Lint \u2713 | Vitest 3/3 \u2713 | Build \u2713. Co-authored-by: yuneng-jiang --- .../api-reference/APIReferenceView.tsx | 89 +++++++++---------- .../api-reference/components/CodeBlock.tsx | 4 +- .../api-reference/components/DocLink.tsx | 9 +- 3 files changed, 49 insertions(+), 53 deletions(-) diff --git a/ui/litellm-dashboard/src/app/(dashboard)/api-reference/APIReferenceView.tsx b/ui/litellm-dashboard/src/app/(dashboard)/api-reference/APIReferenceView.tsx index 5861cc87e5b..35d3f117bd4 100644 --- a/ui/litellm-dashboard/src/app/(dashboard)/api-reference/APIReferenceView.tsx +++ b/ui/litellm-dashboard/src/app/(dashboard)/api-reference/APIReferenceView.tsx @@ -1,6 +1,6 @@ "use client"; import React from "react"; -import { Text, Tab, TabGroup, TabList, TabPanel, TabPanels, Grid } from "@tremor/react"; +import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs"; import CodeBlock from "./components/CodeBlock"; import DocLink from "@/app/(dashboard)/api-reference/components/DocLink"; @@ -21,33 +21,34 @@ const APIReferenceView: React.FC = ({ proxySettings }) => { } return ( - <> - -
- {/* Header row with Docs link on the right */} -
-

- OpenAI Compatible Proxy: API Reference -

- -
+
+
+
+

+ OpenAI Compatible Proxy: API Reference +

+ +
- - LiteLLM is OpenAI Compatible. This means your API Key works with the OpenAI SDK. Just replace the base_url - to point to your litellm proxy. Example Below{" "} - +

+ LiteLLM is OpenAI Compatible. This means your API Key works with the + OpenAI SDK. Just replace the base_url to point to your litellm proxy. + Example Below +

- - - OpenAI Python SDK - LlamaIndex - Langchain Py - - - - + + OpenAI Python SDK + LlamaIndex + Langchain Py + + + - + /> + - - + - + /> + - - + - - - -
- - + /> + + +
+
); }; diff --git a/ui/litellm-dashboard/src/app/(dashboard)/api-reference/components/CodeBlock.tsx b/ui/litellm-dashboard/src/app/(dashboard)/api-reference/components/CodeBlock.tsx index 8d2fa8acb5d..02c3d622888 100644 --- a/ui/litellm-dashboard/src/app/(dashboard)/api-reference/components/CodeBlock.tsx +++ b/ui/litellm-dashboard/src/app/(dashboard)/api-reference/components/CodeBlock.tsx @@ -17,10 +17,10 @@ const CodeBlock = ({ code, language }: CodeBlockProps) => { }; return ( -
+