# Fumadocs (Framework Mode, Next.js): Orama Cloud
URL: /docs/next/search/orama-cloud
Source: https://raw.githubusercontent.com/fuma-nama/fumadocs/refs/heads/main/apps/docs/content/docs/(framework)/[framework]/search/orama-cloud.mdx

Using Orama Cloud with Fumadocs UI.

## Setup [#setup]

Fumadocs CLI can set it up for you, it creates the search dialog, the `static.json` route and a script to sync the search index after each build:

```package-install
npx @fumadocs/cli feature search --provider orama-cloud
```

Or manually:

1. Integrate [Orama Cloud](/docs/headless/search/orama-cloud).

2. Create a search dialog, replace `endpoint` and `api_key` with your desired values.

   ```tsx title="components/search.tsx"
   'use client';

   import {
     SearchDialog,
     SearchDialogClose,
     SearchDialogContent,
     SearchDialogFooter,
     SearchDialogHeader,
     SearchDialogIcon,
     SearchDialogInput,
     SearchDialogList,
     SearchDialogOverlay,
     type SharedProps,
   } from 'fumadocs-ui/components/dialog/search';
   import { useOramaCloudSearch } from 'fumadocs-core/search/client';
   import { OramaCloud } from '@orama/core';

   const orama = new OramaCloud({
     projectId: '',
     apiKey: '',
   });

   export default function CustomSearchDialog(props: SharedProps) {
     const search = useOramaCloudSearch({
       client: orama,
     });

     return (
       <SearchDialog {...search} {...props}>
         <SearchDialogOverlay />
         <SearchDialogContent>
           <SearchDialogHeader>
             <SearchDialogIcon />
             <SearchDialogInput />
             <SearchDialogClose />
           </SearchDialogHeader>
           <SearchDialogList />
           <SearchDialogFooter>
             <a
               href="https://orama.com"
               rel="noreferrer noopener"
               className="ms-auto text-xs text-fd-muted-foreground"
             >
               Search powered by Orama
             </a>
           </SearchDialogFooter>
         </SearchDialogContent>
       </SearchDialog>
     );
   }
   ```

### Replace Search Dialog [#replace-search-dialog]

Pass your search dialog to [`<RootProvider />`](/docs/ui/layouts/root-provider). The root layout is a server component, so wrap the provider in a client component first:

```tsx tab="components/provider.tsx"
'use client';
import { RootProvider } from 'fumadocs-ui/provider/next';
import SearchDialog from '@/components/search';
import type { ReactNode } from 'react';

export function Provider({ children }: { children: ReactNode }) {
  return <RootProvider search={{ SearchDialog }}>{children}</RootProvider>;
}
```

```tsx tab="app/layout.tsx"
// [!code ++]
import { Provider } from '@/components/provider';
import type { ReactNode } from 'react';

export default function Layout({ children }: { children: ReactNode }) {
  return (
    <html lang="en" suppressHydrationWarning>
      <body className="flex flex-col min-h-screen">
        {/* [!code --] */}
        <RootProvider>{children}</RootProvider>
        {/* [!code ++] */}
        <Provider>{children}</Provider>
      </body>
    </html>
  );
}
```