Skip to content

Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.

Redesign header with improved UX and visual hierarchy

Sushmithamallesh6776ad6da0ab
diff --git a/fumadocs/app/global.css b/fumadocs/app/global.css
index e61efedd8..7c7eea9d8 100644
--- a/fumadocs/app/global.css
+++ b/fumadocs/app/global.css
@@ -35,7 +35,7 @@
--color-fd-background: #ffffff;
--color-fd-foreground: #171414;
--color-fd-muted: #f6f4f2;
- --color-fd-muted-foreground: #726f6f;
+ --color-fd-muted-foreground: #5c5858; /* Improved contrast */
--color-fd-border: #e5e0df;
--color-fd-card: #ffffff;
--color-fd-card-foreground: #171414;
@@ -57,7 +57,7 @@
--color-fd-background: #1a1815;
--color-fd-foreground: #e8e4e0;
--color-fd-muted: #2a2725;
- --color-fd-muted-foreground: #9a9590;
+ --color-fd-muted-foreground: #a8a29e; /* Improved contrast */
--color-fd-border: #3d3935;
--color-fd-card: #1a1815;
--color-fd-card-foreground: #e8e4e0;
@@ -172,3 +172,153 @@ a:focus-visible {
padding: 1rem;
border-radius: 0 var(--radius) var(--radius) 0;
}
+
+/* ==========================================================================
+ Header Components
+ ========================================================================== */
+
+/* Shared transition timing */
+:root {
+ --header-transition: 0.15s ease;
+}
+
+/* Header spacing & rhythm */
+#nd-nav {
+ gap: 2rem;
+}
+
+/* Nav links container */
+#nd-nav nav {
+ gap: 0.25rem;
+}
+
+/* Nav link items - consistent height (36px touch target) */
+#nd-nav nav > a {
+ display: inline-flex;
+ align-items: center;
+ height: 2.25rem;
+ padding: 0 0.75rem;
+ font-size: 0.875rem;
+ font-weight: 500;
+ color: var(--color-fd-muted-foreground);
+ border-radius: 0.375rem;
+ transition: color var(--header-transition), background var(--header-transition);
+}
+
+#nd-nav nav > a:hover {
+ color: var(--color-fd-foreground);
+ background: var(--color-fd-accent);
+}
+
+#nd-nav nav > a:focus-visible {
+ outline: 2px solid var(--composio-orange);
+ outline-offset: 2px;
+}
+
+/* Active nav link - underline style */
+#nd-nav nav > a[data-active="true"] {
+ color: var(--composio-orange);
+ position: relative;
+}
+
+#nd-nav nav > a[data-active="true"]:hover {
+ background: transparent;
+}
+
+#nd-nav nav > a[data-active="true"]::after {
+ content: '';
+ position: absolute;
+ bottom: -0.25rem;
+ left: 0.75rem;
+ right: 0.75rem;
+ height: 2px;
+ background: var(--composio-orange);
+ border-radius: 1px;
+}
+
+/* Right side items - consistent gaps */
+#nd-nav > div:last-child {
+ gap: 0.5rem;
+}
+
+/* Theme toggle button */
+.theme-toggle-btn {
+ display: inline-flex;
+ align-items: center;
+ justify-content: center;
+ width: 2.25rem;
+ height: 2.25rem;
+ border: none;
+ background: transparent;
+ border-radius: 0.375rem;
+ color: var(--color-fd-muted-foreground);
+ cursor: pointer;
+ transition: color var(--header-transition), background var(--header-transition);
+}
+
+.theme-toggle-btn:hover {
+ color: var(--color-fd-foreground);
+ background: var(--color-fd-accent);
+}
+
+.theme-toggle-btn:focus-visible {
+ outline: 2px solid var(--composio-orange);
+ outline-offset: 2px;
+}
+
+/* GitHub icon link */
+#nd-nav a[href*="github.com"] {
+ display: inline-flex;
+ align-items: center;
+ justify-content: center;
+ width: 2.25rem;
+ height: 2.25rem;
+ border-radius: 0.375rem;
+ color: var(--color-fd-muted-foreground);
+ transition: color var(--header-transition), background var(--header-transition);
+}
+
+#nd-nav a[href*="github.com"]:hover {
+ color: var(--color-fd-foreground);
+ background: var(--color-fd-accent);
+}
+
+#nd-nav a[href*="github.com"]:focus-visible {
+ outline: 2px solid var(--composio-orange);
+ outline-offset: 2px;
+}
+
+/* Search toggle - match style */
+#nd-nav [data-search-toggle] {
+ height: 2.25rem;
+ border-radius: 0.375rem;
+ transition: border-color var(--header-transition);
+}
+
+#nd-nav [data-search-toggle]:focus-visible {
+ outline: 2px solid var(--composio-orange);
+ outline-offset: 2px;
+}
+
+/* Dashboard button - CTA with consistent height */
+nav a[href*="app.composio"] {
+ display: inline-flex;
+ align-items: center;
+ height: 2.25rem;
+ padding: 0 0.875rem;
+ background: var(--color-fd-primary);
+ color: var(--color-fd-primary-foreground);
+ border-radius: 0.375rem;
+ font-size: 0.8125rem;
+ font-weight: 500;
+ transition: opacity var(--header-transition);
+}
+
+nav a[href*="app.composio"]:hover {
+ opacity: 0.9;
+}
+
+nav a[href*="app.composio"]:focus-visible {
+ outline: 2px solid var(--composio-orange);
+ outline-offset: 2px;
+}
diff --git a/fumadocs/components/theme-toggle.tsx b/fumadocs/components/theme-toggle.tsx
new file mode 100644
index 000000000..1899aa5a5
--- /dev/null
+++ b/fumadocs/components/theme-toggle.tsx
@@ -0,0 +1,29 @@
+'use client';
+
+import { Moon, Sun } from 'lucide-react';
+import { useTheme } from 'next-themes';
+import { useEffect, useState } from 'react';
+
+export function ThemeToggle() {
+ const { setTheme, resolvedTheme } = useTheme();
+ const [mounted, setMounted] = useState(false);
+
+ useEffect(() => {
+ setMounted(true);
+ }, []);
+
+ return (
+ <button
+ type="button"
+ className="theme-toggle-btn"
+ onClick={() => setTheme(resolvedTheme === 'dark' ? 'light' : 'dark')}
+ aria-label="Toggle theme"
+ >
+ {mounted && resolvedTheme === 'dark' ? (
+ <Sun className="size-[18px]" />
+ ) : (
+ <Moon className="size-[18px]" />
+ )}
+ </button>
+ );
+}
diff --git a/fumadocs/lib/layout.shared.tsx b/fumadocs/lib/layout.shared.tsx
index f56d214db..7dbcb6794 100644
--- a/fumadocs/lib/layout.shared.tsx
+++ b/fumadocs/lib/layout.shared.tsx
@@ -1,5 +1,6 @@
import type { BaseLayoutProps } from 'fumadocs-ui/layouts/shared';
import Image from 'next/image';
+import { ThemeToggle } from '@/components/theme-toggle';
// Composio Logo Component with light/dark mode switching
function ComposioLogo() {
@@ -33,9 +34,13 @@ export function baseOptions(): BaseLayoutProps {
title: <ComposioLogo />,
transparentMode: 'top',
},
+ themeSwitch: {
+ enabled: true,
+ component: <ThemeToggle />,
+ },
links: [
{
- text: 'Guide',
+ text: 'Docs',
url: '/docs',
active: 'nested-url',
},
@@ -52,8 +57,24 @@ export function baseOptions(): BaseLayoutProps {
url: '/examples',
},
{
- text: 'Playground',
- url: '/playground',
+ type: 'icon',
+ label: 'GitHub',
+ icon: (
+ <svg fill="currentColor" viewBox="0 0 24 24" className="size-5">
+ <path d="M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12" />
+ </svg>
+ ),
+ text: 'GitHub',
+ url: 'https://github.com/composiohq/composio',
+ external: true,
+ secondary: true,
+ },
+ {
+ type: 'button',
+ text: 'Dashboard',
+ url: 'https://app.composio.dev',
+ external: true,
+ secondary: true,
},
],
};