Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
87 changes: 87 additions & 0 deletions apps/docs/app/components/navbar.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
"use client";

import Link from "next/link";
import { useEffect, useState } from "react";
import { useTheme } from "next-themes";
import { GitHubLogoIcon, SunIcon, MoonIcon } from "@radix-ui/react-icons";

export function Navbar() {
const { resolvedTheme, setTheme } = useTheme();
const [scrolled, setScrolled] = useState(false);

useEffect(() => {
const onScroll = () => setScrolled(window.scrollY > 10);
window.addEventListener("scroll", onScroll, { passive: true });
return () => window.removeEventListener("scroll", onScroll);
}, []);

return (
<header
className={`sticky top-0 z-50 w-full transition-colors duration-300 ${
scrolled ? "" : "bg-fd-background"
}`}
>
{scrolled && (
<div className="pointer-events-none absolute inset-x-0 top-0 h-16 bg-linear-to-b from-fd-background via-fd-background/70 to-transparent backdrop-blur-xl mask-[linear-gradient(to_bottom,black_50%,transparent)] dark:mask-[linear-gradient(to_bottom,black_40%,transparent)]" />
)}

{/* Nav content */}
<div className="relative flex h-14 items-center justify-between mx-auto max-w-4xl sm:px-6">
<Link
href="/"
className="text-base font-bold italic text-fd-foreground"
style={{ fontFamily: "'Georgia', 'Times New Roman', serif" }}
>
<span className="shimmer">Chords</span>
</Link>

<div className="flex items-center gap-1 sm:gap-4">
<Link
href="/docs"
className="text-sm text-fd-muted-foreground transition-colors hover:text-fd-foreground"
>
Docs
</Link>
<a
href="https://github.com/assistant-ui/ux-primitives/tree/main/apps/example"
className="hidden text-sm text-fd-muted-foreground transition-colors hover:text-fd-foreground sm:block"
target="_blank"
rel="noopener noreferrer"
>
Examples
</a>
<a
href="https://www.assistant-ui.com/"
className="text-sm text-fd-muted-foreground transition-colors hover:text-fd-foreground"
target="_blank"
rel="noopener noreferrer"
>
assistant-ui
</a>
<a
href="https://github.com/assistant-ui/ux-primitives"
className="p-1 text-fd-muted-foreground transition-colors hover:text-fd-foreground"
target="_blank"
rel="noopener noreferrer"
aria-label="GitHub"
>
<GitHubLogoIcon className="h-4 w-4" />
</a>
<button
onClick={() =>
setTheme(resolvedTheme === "dark" ? "light" : "dark")
}
className="p-1 text-fd-muted-foreground transition-colors hover:text-fd-foreground"
aria-label="Toggle theme"
>
{resolvedTheme === "dark" ? (
<SunIcon className="h-4 w-4" />
) : (
<MoonIcon className="h-4 w-4" />
)}
</button>
</div>
</div>
</header>
);
}
2 changes: 1 addition & 1 deletion apps/docs/app/docs/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export default function Layout({ children }: { children: ReactNode }) {
<DocsLayout
tree={source.pageTree}
nav={{
title: "Chords",
enabled: false,
}}
sidebar={{
defaultOpenLevel: 2,
Expand Down
14 changes: 14 additions & 0 deletions apps/docs/app/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,17 @@
@import "fumadocs-ui/css/preset.css";
@import "../node_modules/tw-shimmer/src/index.css";
@source "../node_modules/@assistant-ui/ux-primitives/dist";

/* Align Fumadocs background with landing page palette */
@theme {
--color-fd-background: #FAF9F6;
}

.dark {
--color-fd-background: #0A0A0A;
}

/* Match sidebar bg to page background without affecting card components */
#nd-sidebar {
--color-fd-card: var(--color-fd-background);
}
6 changes: 5 additions & 1 deletion apps/docs/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import "./globals.css";
import type { ReactNode } from "react";
import type { Metadata } from "next";
import { Provider } from "./provider";
import { Navbar } from "./components/navbar";

export const metadata: Metadata = {
title: {
Expand All @@ -16,7 +17,10 @@ export default function RootLayout({ children }: { children: ReactNode }) {
return (
<html lang="en" suppressHydrationWarning>
<body className="flex min-h-screen flex-col antialiased">
<Provider>{children}</Provider>
<Provider>
<Navbar />
{children}
</Provider>
</body>
</html>
);
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ const minorChords = [

export default function HomePage() {
return (
<main className="flex flex-1 flex-col items-center justify-center px-4 py-16">
<main className="flex flex-1 flex-col items-center justify-center px-4 pt-8 pb-16 bg-fd-background">
<div className="mx-auto max-w-3xl text-center">
<h1
className="text-4xl font-bold tracking-tight sm:text-5xl"
Expand Down
1 change: 1 addition & 0 deletions apps/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"fumadocs-mdx": "^14.2.6",
"fumadocs-ui": "^16.5.0",
"next": "16.1.6",
"next-themes": "^0.4.6",
"react": "19.2.3",
"react-dom": "19.2.3",
"tw-shimmer": "^0.4.6"
Expand Down
3 changes: 3 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.