---
title: Geistdocs Provider
description: The root provider component that handles notifications, search and analytics
type: reference
summary: The root provider component that wraps your application to handle toast notifications, search, and analytics.
prerequisites:
  - /docs/getting-started
related:
  - /docs/configuration
---

# Geistdocs Provider



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:

2. **Toast Notifications** - Provides a global notification system for user feedback
3. **Analytics** - Integrates Vercel Analytics for tracking page views and performance
4. **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:

```tsx title="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:

```tsx title="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.


---

For a semantic overview of all documentation, see [/sitemap.md](/sitemap.md)

For an index of all available documentation, see [/llms.txt](/llms.txt)