Geistdocs Provider

The root provider component that handles notifications, search and analytics

The GeistdocsProvider is a wrapper component that sits at the root of your application. It wraps Fumadocs' RootProvider and adds Geistdocs-specific functionality to make everything work seamlessly.

What It Does

The provider handles these main things for you:

  1. Toast Notifications - Provides a global notification system for user feedback
  2. Analytics - Integrates Vercel Analytics for tracking page views and performance
  3. Search - Configures the search dialog and connects it to your search API

Usage

Ensure your application is wrapped with the provider in your root layout:

app/layout.tsx
import { GeistdocsProvider } from "@/components/geistdocs/provider";

const Layout = ({ children }: LayoutProps) => (
  <html lang="en">
    <body>
      <GeistdocsProvider>
        <Navbar />
        {children}
      </GeistdocsProvider>
    </body>
  </html>
);

That's it. The provider handles everything automatically.

AI Sidebar

When users open the AI chat on desktop, the provider automatically adds padding to prevent content from being hidden behind the sidebar. On mobile, the chat opens as a drawer instead, so no padding is needed.

You don't need to do anything - the provider detects the screen size and chat state automatically.

Toast Notifications

The provider includes a global toast notification system. Use it anywhere in your app:

page.tsx
import { toast } from "sonner";

toast.success("Changes saved");
toast.error("Something went wrong");

Analytics

Vercel Analytics is automatically included and tracks:

  • Page views
  • Web Vitals
  • User interactions
  • Performance metrics

No configuration needed - it works automatically when deployed on Vercel.

On this page