Skip to content

Production-ready animations, transitions, backgrounds, and scenes for Remotion

feat: added docs toc sidebar

dev_wandrydfe91dfb8c84
diff --git a/app/docs/[[...slug]]/page.tsx b/app/docs/[[...slug]]/page.tsx
index 8fafee7e..e013efc4 100644
--- a/app/docs/[[...slug]]/page.tsx
+++ b/app/docs/[[...slug]]/page.tsx
@@ -5,6 +5,7 @@ import {
DocsTitle,
} from "fumadocs-ui/page";
import { notFound } from "next/navigation";
+import { DocsAdRail } from "@/components/docs/docs-ad-rail";
import { getMDXComponents } from "@/mdx-components";
import { source } from "@/source";
@@ -20,9 +21,8 @@ export default async function Page(props: {
return (
<DocsPage
- full
breadcrumb={{ enabled: false }}
- tableOfContent={{ enabled: false }}
+ tableOfContent={{ enabled: true, component: <DocsAdRail /> }}
tableOfContentPopover={{ enabled: false }}
footer={{ enabled: true }}
>
diff --git a/app/docs/layout.tsx b/app/docs/layout.tsx
index 27fc997c..5c4a3d40 100644
--- a/app/docs/layout.tsx
+++ b/app/docs/layout.tsx
@@ -1,7 +1,6 @@
import type { ReactNode } from "react";
import { DocsHeader } from "@/components/docs/docs-header";
import { DocsShell } from "@/components/docs/docs-shell";
-import { DocsSponsorBanner } from "@/components/docs/docs-sponsor-banner";
import { DocsTabsBar } from "@/components/docs/docs-tabs-bar";
import { splitDocsTree } from "@/lib/docs-tabs";
import { withNewBadges } from "@/lib/with-new-badges";
@@ -24,15 +23,9 @@ export default async function Layout({ children }: { children: ReactNode }) {
over the sidebar, tabs starting at the article column's left edge. */}
<DocsHeader />
<DocsTabsBar />
- {/* `relative` anchor begins just below the sticky tab bar so the floating
- sponsor banner's `top-0` lands at the docs content top. The banner is
- absolute (non-sticky) and overlaps the article/TOC top-right. */}
- <div className="relative">
- <DocsSponsorBanner />
- <DocsShell componentsTree={components} primitivesTree={primitives}>
- {children}
- </DocsShell>
- </div>
+ <DocsShell componentsTree={components} primitivesTree={primitives}>
+ {children}
+ </DocsShell>
</>
);
}
diff --git a/components/docs/docs-ad-rail.tsx b/components/docs/docs-ad-rail.tsx
new file mode 100644
index 00000000..b25f5884
--- /dev/null
+++ b/components/docs/docs-ad-rail.tsx
@@ -0,0 +1,14 @@
+"use client";
+
+import { DocsSponsor } from "./docs-sponsor";
+
+export function DocsAdRail() {
+ return (
+ <aside
+ id="nd-toc"
+ className="sticky top-(--fd-docs-row-1) flex h-[calc(var(--fd-docs-height)-var(--fd-docs-row-1))] w-(--fd-toc-width) flex-col gap-4 overflow-y-auto [grid-area:toc] pt-12 ps-4 pe-4 pb-6 max-xl:hidden"
+ >
+ <DocsSponsor />
+ </aside>
+ );
+}
diff --git a/components/docs/docs-shell.tsx b/components/docs/docs-shell.tsx
index a0b49d4f..01a4b09a 100644
--- a/components/docs/docs-shell.tsx
+++ b/components/docs/docs-shell.tsx
@@ -56,13 +56,11 @@ export function DocsShell({
sidebar={{ collapsible: false }}
containerProps={{ className: "[--fd-banner-height:2.75rem]" }}
>
- <div className="relative isolate">
- <div
- aria-hidden
- className="pointer-events-none absolute inset-x-0 top-0 -z-10 h-[360px] bg-grid-fade"
- />
- {children}
- </div>
+ <div
+ aria-hidden
+ className="pointer-events-none -z-10 h-[360px] w-full self-start [grid-area:main] bg-grid-fade"
+ />
+ {children}
</DocsLayout>
);
}
diff --git a/components/docs/docs-sponsor-banner.tsx b/components/docs/docs-sponsor-banner.tsx
deleted file mode 100644
index 4ad53fb6..00000000
--- a/components/docs/docs-sponsor-banner.tsx
+++ /dev/null
@@ -1,61 +0,0 @@
-import { ArrowUpRight } from "lucide-react";
-import Link from "next/link";
-import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
-import { getGoldSponsors } from "@/config/sponsors";
-import { cn } from "@/lib/utils";
-
-export function DocsSponsorBanner() {
- const goldSponsors = getGoldSponsors();
-
- return (
- <div className="pointer-events-none absolute right-0 top-10 z-20 mx-auto hidden w-full max-w-(--fd-layout-width) justify-end px-4 [--fd-layout-width:97rem] lg:flex">
- <Card size="sm" className="pointer-events-auto w-72 gap-4 shadow-2xs">
- <CardHeader className="flex flex-row items-center justify-between gap-2">
- <CardTitle>Sponsors</CardTitle>
- <Link
- href="/sponsors"
- className="inline-flex items-center gap-1 text-xs font-medium text-muted-foreground transition-colors hover:text-foreground focus-visible:text-foreground focus-visible:outline-none"
- >
- Become a sponsor
- <ArrowUpRight className="size-3.5" aria-hidden="true" />
- </Link>
- </CardHeader>
-
- <CardContent className="flex flex-col gap-3">
- <span className="text-[0.625rem] font-medium uppercase tracking-wide text-muted-foreground">
- Gold
- </span>
-
- {goldSponsors.length > 0 ? (
- <div className="flex flex-col gap-2">
- {goldSponsors.map((sponsor) => (
- <a
- key={sponsor.id}
- href={sponsor.website}
- target="_blank"
- rel="noreferrer"
- className="group flex items-center justify-center gap-3 rounded-2xl surface-card px-3 py-2.5 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/40"
- >
- {/** biome-ignore lint/performance/noImgElement: sponsor logos are SVGs of arbitrary sizes */}
- <img
- src={sponsor.logoUrl}
- alt={sponsor.name}
- className={cn(
- "max-h-6 w-auto shrink-0 object-contain opacity-80 grayscale transition-all duration-300 dark:[filter:grayscale(1)_brightness(0)_invert(1)] ",
- sponsor.customStyles,
- )}
- style={{ transform: `scale(${sponsor.logoScale ?? 1})` }}
- />
- </a>
- ))}
- </div>
- ) : (
- <span className="rounded-2xl surface-card px-3 py-2.5 text-xs font-medium text-muted-foreground">
- Your logo here
- </span>
- )}
- </CardContent>
- </Card>
- </div>
- );
-}
diff --git a/components/docs/docs-sponsor.tsx b/components/docs/docs-sponsor.tsx
new file mode 100644
index 00000000..329e8e34
--- /dev/null
+++ b/components/docs/docs-sponsor.tsx
@@ -0,0 +1,58 @@
+import React from "react";
+import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
+import { getGoldSponsors } from "@/config/sponsors";
+import Link from "next/link";
+import { ArrowUpRight } from "lucide-react";
+import { cn } from "@/lib/utils";
+
+export const DocsSponsor: React.FC = () => {
+ const goldSponsors = getGoldSponsors();
+
+ return (
+ <Card size="sm" className="w-full gap-4 shadow-2xs">
+ <CardHeader className="flex flex-row items-center justify-between gap-2">
+ <CardTitle>Sponsors</CardTitle>
+ <Link
+ href="/sponsors"
+ className="inline-flex items-center gap-1 text-[10px] font-medium text-muted-foreground transition-colors hover:text-foreground focus-visible:text-foreground focus-visible:outline-none"
+ >
+ Become a sponsor
+ <ArrowUpRight className="size-3.5" aria-hidden="true" />
+ </Link>
+ </CardHeader>
+
+ <CardContent className="flex flex-col gap-1">
+ {/* <span className="text-xs font-medium text-muted-foreground">Gold</span> */}
+
+ {goldSponsors.length > 0 ? (
+ <div className="flex flex-col gap-2">
+ {goldSponsors.map((sponsor) => (
+ <a
+ key={sponsor.id}
+ href={sponsor.website}
+ target="_blank"
+ rel="noreferrer"
+ className="group flex items-center justify-center gap-3 rounded-2xl surface-card px-3 py-2.5 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/40"
+ >
+ {/** biome-ignore lint/performance/noImgElement: sponsor logos are SVGs of arbitrary sizes */}
+ <img
+ src={sponsor.logoUrl}
+ alt={sponsor.name}
+ className={cn(
+ "max-h-6 w-auto shrink-0 object-contain opacity-80 grayscale transition-all duration-300 dark:[filter:grayscale(1)_brightness(0)_invert(1)] ",
+ sponsor.customStyles,
+ )}
+ style={{ transform: `scale(${sponsor.logoScale ?? 1})` }}
+ />
+ </a>
+ ))}
+ </div>
+ ) : (
+ <span className="rounded-2xl surface-card px-3 py-2.5 text-xs font-medium text-muted-foreground">
+ Your logo here
+ </span>
+ )}
+ </CardContent>
+ </Card>
+ );
+};
diff --git a/config/sponsors.ts b/config/sponsors.ts
index 106b6eb7..149824dd 100644
--- a/config/sponsors.ts
+++ b/config/sponsors.ts
@@ -59,11 +59,6 @@ export const sponsors: Sponsor[] = [
},
].filter(sponsor => !sponsor.isPaste);
-/**
- * The current "gold" sponsors — our highest tier is `partner`, so gold maps to
- * the partner-tier entries. Returns an empty array when none are active, in
- * which case the banner falls back to a "Your logo here" placeholder.
- */
export function getGoldSponsors(): Sponsor[] {
return sponsors.filter((sponsor) => sponsor.tier === "partner");
}