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): give the shared product-link class a focus ring

ryan-crabbe-berri929946bdc17e
diff --git a/ui/litellm-dashboard/src/components/Navbar/DocsLink/DocsLink.test.tsx b/ui/litellm-dashboard/src/components/Navbar/DocsLink/DocsLink.test.tsx
index d5a155cf503..dec76041802 100644
--- a/ui/litellm-dashboard/src/components/Navbar/DocsLink/DocsLink.test.tsx
+++ b/ui/litellm-dashboard/src/components/Navbar/DocsLink/DocsLink.test.tsx
@@ -24,4 +24,19 @@ describe("DocsLink", () => {
}
expect(link).not.toHaveClass("text-muted-foreground");
});
+
+ it("carries a focus ring, so tabbing to Docs looks like tabbing to Blog", () => {
+ render(<DocsLink />);
+
+ const link = screen.getByRole("link", { name: "Docs" });
+ expect(link).toHaveClass("focus-visible:ring-3");
+ expect(link).toHaveClass("focus-visible:ring-ring/50");
+ });
+
+ it("stays a link rather than being relabelled as a button by the Button primitive", () => {
+ render(<DocsLink />);
+
+ expect(screen.getByRole("link", { name: "Docs" })).toBeInTheDocument();
+ expect(screen.queryByRole("button", { name: "Docs" })).not.toBeInTheDocument();
+ });
});
diff --git a/ui/litellm-dashboard/src/components/Navbar/DocsLink/DocsLink.tsx b/ui/litellm-dashboard/src/components/Navbar/DocsLink/DocsLink.tsx
index 9176e1f9c38..9b4f4c90b64 100644
--- a/ui/litellm-dashboard/src/components/Navbar/DocsLink/DocsLink.tsx
+++ b/ui/litellm-dashboard/src/components/Navbar/DocsLink/DocsLink.tsx
@@ -4,11 +4,14 @@ import React from "react";
export const DOCS_URL = "https://docs.litellm.ai/docs/";
+const ChevronWidthSpacer: React.FC = () => (
+ <ChevronDown className="pointer-events-none size-2.5 opacity-0" aria-hidden />
+);
+
export const DocsLink: React.FC = () => (
<a href={DOCS_URL} target="_blank" rel="noopener noreferrer" className={NAV_PRODUCT_LINK_CLASS}>
Docs
- {/* Docs is a single outbound link; the hidden chevron keeps its box identical to the Blog dropdown trigger. */}
- <ChevronDown className="pointer-events-none size-2.5 opacity-0" aria-hidden />
+ <ChevronWidthSpacer />
</a>
);
diff --git a/ui/litellm-dashboard/src/components/Navbar/navProductLinkClass.ts b/ui/litellm-dashboard/src/components/Navbar/navProductLinkClass.ts
index e0fd000ab97..56b0d51401d 100644
--- a/ui/litellm-dashboard/src/components/Navbar/navProductLinkClass.ts
+++ b/ui/litellm-dashboard/src/components/Navbar/navProductLinkClass.ts
@@ -1,3 +1,3 @@
-/** Shared styling for Docs / Blog in the top nav (product navigation zone). */
+/** Shared styling for Docs / Blog in the top nav (product navigation zone). Focus ring matches the Button primitive. */
export const NAV_PRODUCT_LINK_CLASS =
- "inline-flex h-9 shrink-0 items-center justify-center gap-1 rounded-md px-2 text-sm font-medium leading-none text-foreground transition-colors hover:bg-accent ";
+ "inline-flex h-9 shrink-0 items-center justify-center gap-1 rounded-md px-2 text-sm font-medium leading-none text-foreground outline-none transition-colors hover:bg-accent focus-visible:ring-3 focus-visible:ring-ring/50 ";