Skip to content

🐸 Rybbit - open-source and privacy-friendly alternative to Google Analytics that is 10x more intuitive.

Update dependencies and enhance layout styles

Bill Yang78b86f7b8263
diff --git a/docs/content/docs/(docs)/index.mdx b/docs/content/docs/(docs)/index.mdx
index d69607dce..7f02356ec 100644
--- a/docs/content/docs/(docs)/index.mdx
+++ b/docs/content/docs/(docs)/index.mdx
@@ -45,7 +45,7 @@ import {
**Rybbit** is a powerful open source web and products analytics platform. Check out our [live demo](https://demo.rybbit.com/81) using a real production site.
-<div className="relative z-10 rounded-lg overflow-hidden border-8 border-neutral-100/5 shadow-2xl shadow-emerald-900/10">
+<div className="relative rounded-lg overflow-hidden border-8 border-neutral-100/5 shadow-2xl shadow-emerald-900/10">
<iframe
src="https://demo.rybbit.com/81"
width="1300"
diff --git a/docs/package-lock.json b/docs/package-lock.json
index e725c580b..8273af89b 100644
--- a/docs/package-lock.json
+++ b/docs/package-lock.json
@@ -19,9 +19,9 @@
"clsx": "^2.1.1",
"country-flag-icons": "^1.6.17",
"embla-carousel-react": "^8.6.0",
- "fumadocs-core": "16.10.4",
+ "fumadocs-core": "16.10.5",
"fumadocs-mdx": "15.0.12",
- "fumadocs-ui": "16.10.4",
+ "fumadocs-ui": "16.10.5",
"lodash": "^4.18.1",
"lucide-react": "^1.21.0",
"luxon": "^3.7.2",
@@ -7203,9 +7203,9 @@
}
},
"node_modules/fumadocs-core": {
- "version": "16.10.4",
- "resolved": "https://registry.npmjs.org/fumadocs-core/-/fumadocs-core-16.10.4.tgz",
- "integrity": "sha512-YpS6i8QFGgnXfE90MjlNPNE0tW3v/kg0n34CTP1SREHrFaXiPlQXnaBRTpBVT1g5TCK43yK6bkpKkkT8Ji+P4w==",
+ "version": "16.10.5",
+ "resolved": "https://registry.npmjs.org/fumadocs-core/-/fumadocs-core-16.10.5.tgz",
+ "integrity": "sha512-e/xrZnKvQo8bF/WYMwPuym8PR3OtjZzHy0S/EIOvGwjKRgVq9z6J58zaBpi4LvYtPVZxNGsxdZVlmZXCVWq4FQ==",
"license": "MIT",
"dependencies": {
"@orama/orama": "^3.1.18",
@@ -7368,9 +7368,9 @@
}
},
"node_modules/fumadocs-ui": {
- "version": "16.10.4",
- "resolved": "https://registry.npmjs.org/fumadocs-ui/-/fumadocs-ui-16.10.4.tgz",
- "integrity": "sha512-/PzeT0ml4V87ilvdf10O4/EjGMJe5qKLrN9dG6wKYxWvvZgZE9414E/36LHOf+vFmr40Shjnl6QpkHhlQYwtcw==",
+ "version": "16.10.5",
+ "resolved": "https://registry.npmjs.org/fumadocs-ui/-/fumadocs-ui-16.10.5.tgz",
+ "integrity": "sha512-vd69ckYx/4a1aoJTCUJ5LBkqNeOFxm3r+8SK9bVYaeHJrY/n8+4W6b0soqxVqgj1UwNmgovoAg0vlsYmSxZBgQ==",
"license": "MIT",
"dependencies": {
"@fuma-translate/react": "^1.0.2",
@@ -7400,7 +7400,7 @@
"@takumi-rs/image-response": "*",
"@types/mdx": "*",
"@types/react": "*",
- "fumadocs-core": "16.10.4",
+ "fumadocs-core": "16.10.5",
"next": "16.x.x",
"react": "^19.2.0",
"react-dom": "^19.2.0"
diff --git a/docs/package.json b/docs/package.json
index 2cbee2be5..e35dc6856 100644
--- a/docs/package.json
+++ b/docs/package.json
@@ -20,9 +20,9 @@
"clsx": "^2.1.1",
"country-flag-icons": "^1.6.17",
"embla-carousel-react": "^8.6.0",
- "fumadocs-core": "16.10.4",
+ "fumadocs-core": "16.10.5",
"fumadocs-mdx": "15.0.12",
- "fumadocs-ui": "16.10.4",
+ "fumadocs-ui": "16.10.5",
"lodash": "^4.18.1",
"lucide-react": "^1.21.0",
"luxon": "^3.7.2",
diff --git a/docs/src/app/[locale]/docs/layout.tsx b/docs/src/app/[locale]/docs/layout.tsx
index af3c1bb23..c7c2d0fc4 100644
--- a/docs/src/app/[locale]/docs/layout.tsx
+++ b/docs/src/app/[locale]/docs/layout.tsx
@@ -1,4 +1,5 @@
-import { DocsLayout } from "fumadocs-ui/layouts/docs";
+import { DocsLayout } from "fumadocs-ui/layouts/notebook";
+import { getLayoutTabs } from "fumadocs-ui/layouts/shared";
import type { ReactNode } from "react";
import { baseOptions } from "@/app/[locale]/layout.config";
import { source } from "@/lib/source";
@@ -12,10 +13,41 @@ export default async function Layout({
params: Promise<{ locale: string }>;
}) {
const { locale } = await params;
+ const tree = source.pageTree[locale];
+ const { nav, ...base } = baseOptions(locale);
+
+ // Mintlify-style section tabs in the navbar (one per `root: true` folder:
+ // Documentation + API Reference). Built server-side so no function crosses
+ // the RSC boundary. The navbar renderer only shows `title`, while the mobile
+ // dropdown renders `icon` in its own slot β€” so we fold the folder icon into
+ // `title` (for the navbar) and drop `icon`, which avoids rendering it twice
+ // on mobile. We use the raw `node.icon` (an inline <svg>) rather than the
+ // default-transformed `option.icon`, which fumadocs wraps in a <div>: a
+ // <div> inside the dropdown's <p> is invalid HTML and breaks hydration.
+ // Styling into prominent pills lives in `global.css` (`#nd-subnav`).
+ const tabs = getLayoutTabs(tree, {
+ transform: (option, node) => ({
+ ...option,
+ icon: undefined,
+ title: (
+ <>
+ {node.icon ? <span className="fd-tab-icon">{node.icon}</span> : null}
+ {option.title}
+ </>
+ ),
+ }),
+ });
+
return (
<DocsLayout
- tree={source.pageTree[locale]}
- {...baseOptions(locale)}
+ tree={tree}
+ {...base}
+ // `mode: 'top'` keeps the logo + search in a full-width top bar and drops
+ // the tab row beneath it, so the chrome spans the page instead of the
+ // notebook default that pins the sidebar to the edge and leaves a gutter.
+ nav={{ ...nav, mode: "top" }}
+ tabMode="navbar"
+ tabs={tabs}
githubUrl="https://github.com/rybbit-io/rybbit"
links={[
{
diff --git a/docs/src/app/[locale]/layout.config.tsx b/docs/src/app/[locale]/layout.config.tsx
index aa368b424..443ee4e83 100644
--- a/docs/src/app/[locale]/layout.config.tsx
+++ b/docs/src/app/[locale]/layout.config.tsx
@@ -11,6 +11,7 @@ import Image from "next/image";
export function baseOptions(lang: string): BaseLayoutProps {
return {
nav: {
+ transparentMode: "top",
title: (
<>
<Image
diff --git a/docs/src/app/global.css b/docs/src/app/global.css
index bc995c91d..18fcc02a8 100644
--- a/docs/src/app/global.css
+++ b/docs/src/app/global.css
@@ -8,11 +8,74 @@
@custom-variant dark (&:is(.dark *));
:root {
- --color-fd-primary: rgb(16 185 129); /* emerald-500 */ --radius: 0.625rem; --background: oklch(1 0 0); --foreground: oklch(0.145 0 0); --card: oklch(1 0 0); --card-foreground: oklch(0.145 0 0); --popover: oklch(1 0 0); --popover-foreground: oklch(0.145 0 0); --primary: oklch(0.205 0 0); --primary-foreground: oklch(0.985 0 0); --secondary: oklch(0.97 0 0); --secondary-foreground: oklch(0.205 0 0); --muted: oklch(0.97 0 0); --muted-foreground: oklch(0.556 0 0); --accent: oklch(0.97 0 0); --accent-foreground: oklch(0.205 0 0); --destructive: oklch(0.577 0.245 27.325); --border: oklch(0.922 0 0); --input: oklch(0.922 0 0); --ring: oklch(0.708 0 0); --chart-1: oklch(0.646 0.222 41.116); --chart-2: oklch(0.6 0.118 184.704); --chart-3: oklch(0.398 0.07 227.392); --chart-4: oklch(0.828 0.189 84.429); --chart-5: oklch(0.769 0.188 70.08); --sidebar: oklch(0.985 0 0); --sidebar-foreground: oklch(0.145 0 0); --sidebar-primary: oklch(0.205 0 0); --sidebar-primary-foreground: oklch(0.985 0 0); --sidebar-accent: oklch(0.97 0 0); --sidebar-accent-foreground: oklch(0.205 0 0); --sidebar-border: oklch(0.922 0 0); --sidebar-ring: oklch(0.708 0 0);
+ --color-fd-primary: rgb(16 185 129); /* emerald-500 */
+ --radius: 0.625rem;
+ --background: oklch(1 0 0);
+ --foreground: oklch(0.145 0 0);
+ --card: oklch(1 0 0);
+ --card-foreground: oklch(0.145 0 0);
+ --popover: oklch(1 0 0);
+ --popover-foreground: oklch(0.145 0 0);
+ --primary: oklch(0.205 0 0);
+ --primary-foreground: oklch(0.985 0 0);
+ --secondary: oklch(0.97 0 0);
+ --secondary-foreground: oklch(0.205 0 0);
+ --muted: oklch(0.97 0 0);
+ --muted-foreground: oklch(0.556 0 0);
+ --accent: oklch(0.97 0 0);
+ --accent-foreground: oklch(0.205 0 0);
+ --destructive: oklch(0.577 0.245 27.325);
+ --border: oklch(0.922 0 0);
+ --input: oklch(0.922 0 0);
+ --ring: oklch(0.708 0 0);
+ --chart-1: oklch(0.646 0.222 41.116);
+ --chart-2: oklch(0.6 0.118 184.704);
+ --chart-3: oklch(0.398 0.07 227.392);
+ --chart-4: oklch(0.828 0.189 84.429);
+ --chart-5: oklch(0.769 0.188 70.08);
+ --sidebar: oklch(0.985 0 0);
+ --sidebar-foreground: oklch(0.145 0 0);
+ --sidebar-primary: oklch(0.205 0 0);
+ --sidebar-primary-foreground: oklch(0.985 0 0);
+ --sidebar-accent: oklch(0.97 0 0);
+ --sidebar-accent-foreground: oklch(0.205 0 0);
+ --sidebar-border: oklch(0.922 0 0);
+ --sidebar-ring: oklch(0.708 0 0);
}
.dark {
- --color-fd-primary: rgb(16 185 129); /* emerald-500 */ --background: oklch(0.145 0 0); --foreground: oklch(0.985 0 0); --card: oklch(0.205 0 0); --card-foreground: oklch(0.985 0 0); --popover: oklch(0.205 0 0); --popover-foreground: oklch(0.985 0 0); --primary: oklch(0.922 0 0); --primary-foreground: oklch(0.205 0 0); --secondary: oklch(0.269 0 0); --secondary-foreground: oklch(0.985 0 0); --muted: oklch(0.269 0 0); --muted-foreground: oklch(0.708 0 0); --accent: oklch(0.269 0 0); --accent-foreground: oklch(0.985 0 0); --destructive: oklch(0.704 0.191 22.216); --border: oklch(1 0 0 / 10%); --input: oklch(1 0 0 / 15%); --ring: oklch(0.556 0 0); --chart-1: oklch(0.488 0.243 264.376); --chart-2: oklch(0.696 0.17 162.48); --chart-3: oklch(0.769 0.188 70.08); --chart-4: oklch(0.627 0.265 303.9); --chart-5: oklch(0.645 0.246 16.439); --sidebar: oklch(0.205 0 0); --sidebar-foreground: oklch(0.985 0 0); --sidebar-primary: oklch(0.488 0.243 264.376); --sidebar-primary-foreground: oklch(0.985 0 0); --sidebar-accent: oklch(0.269 0 0); --sidebar-accent-foreground: oklch(0.985 0 0); --sidebar-border: oklch(1 0 0 / 10%); --sidebar-ring: oklch(0.556 0 0);
+ --color-fd-primary: rgb(16 185 129); /* emerald-500 */
+ --background: oklch(0.145 0 0);
+ --foreground: oklch(0.985 0 0);
+ --card: oklch(0.205 0 0);
+ --card-foreground: oklch(0.985 0 0);
+ --popover: oklch(0.205 0 0);
+ --popover-foreground: oklch(0.985 0 0);
+ --primary: oklch(0.922 0 0);
+ --primary-foreground: oklch(0.205 0 0);
+ --secondary: oklch(0.269 0 0);
+ --secondary-foreground: oklch(0.985 0 0);
+ --muted: oklch(0.269 0 0);
+ --muted-foreground: oklch(0.708 0 0);
+ --accent: oklch(0.269 0 0);
+ --accent-foreground: oklch(0.985 0 0);
+ --destructive: oklch(0.704 0.191 22.216);
+ --border: oklch(1 0 0 / 10%);
+ --input: oklch(1 0 0 / 15%);
+ --ring: oklch(0.556 0 0);
+ --chart-1: oklch(0.488 0.243 264.376);
+ --chart-2: oklch(0.696 0.17 162.48);
+ --chart-3: oklch(0.769 0.188 70.08);
+ --chart-4: oklch(0.627 0.265 303.9);
+ --chart-5: oklch(0.645 0.246 16.439);
+ --sidebar: oklch(0.205 0 0);
+ --sidebar-foreground: oklch(0.985 0 0);
+ --sidebar-primary: oklch(0.488 0.243 264.376);
+ --sidebar-primary-foreground: oklch(0.985 0 0);
+ --sidebar-accent: oklch(0.269 0 0);
+ --sidebar-accent-foreground: oklch(0.985 0 0);
+ --sidebar-border: oklch(1 0 0 / 10%);
+ --sidebar-ring: oklch(0.556 0 0);
}
body {
@@ -137,3 +200,56 @@ pre {
@apply bg-background text-foreground;
}
}
+
+/* ── Docs section tabs ───────────────────────────────────────────────────
+ The docs use the fumadocs "notebook" layout with `tabMode="navbar"`, which
+ renders one tab per `root: true` folder (Documentation / API Reference) in
+ the sub-navbar. These rules restyle the stock underline tabs into prominent,
+ Mintlify-style pills so the section switcher reads clearly. Rules are
+ unlayered, so they win over the layered Tailwind utilities the layout emits
+ without needing `!important`. */
+
+/* Folder icon folded into each tab title (layout.tsx). Sized here so it works
+ in both the navbar pills and the mobile section dropdown. */
+.fd-tab-icon {
+ display: inline-flex;
+ align-items: center;
+ margin-inline-end: 0.4rem;
+}
+
+.fd-tab-icon svg {
+ width: 1rem;
+ height: 1rem;
+}
+
+#nd-subnav [data-header-tabs] {
+ align-items: center;
+ gap: 0.375rem;
+}
+
+#nd-subnav [data-header-tabs] a {
+ border-bottom: none;
+ gap: 0;
+ padding-block: 0.3rem;
+ padding-inline: 0.7rem;
+ border-radius: calc(var(--radius) - 2px);
+ border: 1px solid transparent;
+ font-weight: 500;
+ color: var(--color-fd-muted-foreground);
+ transition:
+ color 0.15s ease,
+ background-color 0.15s ease,
+ border-color 0.15s ease;
+}
+
+#nd-subnav [data-header-tabs] a:hover {
+ background-color: var(--color-fd-accent);
+ color: var(--color-fd-accent-foreground);
+}
+
+/* active tab β€” fumadocs marks the selected link with `border-fd-primary` */
+#nd-subnav [data-header-tabs] a.border-fd-primary {
+ color: var(--color-fd-primary);
+ background-color: color-mix(in oklch, var(--color-fd-primary) 12%, transparent);
+ border-color: color-mix(in oklch, var(--color-fd-primary) 35%, transparent);
+}