FeaturesCMSNotion
PreviousNext

Search

Add searchable Notion content UI and API routes.

What It Does

Provides backend search endpoint helpers and frontend SearchDialog UI component.

When To Use

  • You need in-app search over Notion-backed content.

Prerequisites

  • Notion content configured.
  • API route enabled.

How To Use

Component source

components/ui/search-dialog.tsx
'use client';

import { Badge } from '@kit/ui/badge';
import { Button } from '@kit/ui/button';
import {
    Command,
    CommandDialog,
    CommandEmpty,
    CommandGroup,
    CommandInput,
Get the Kit
Kit required to see the full code

Video walkthrough

Connect your Notion database before enabling search

Backend route

app/api/notion/search/route.ts
import { createNotionSearchHandler } from '@kit/notion/api';
import { notionConfig } from '~/config/cms.config';
 
export const POST = createNotionSearchHandler(notionConfig);

Frontend dialog

import { SearchDialog } from '@kit/notion/ui/search-dialog';
 
<SearchDialog config={notionConfig} contentType="posts" placeholder="Search posts..." />

API Reference

SearchDialogProps

PropTypeDefault
config*
TConfig
contentType*
keyof...
placeholder
string
className
string

MCP Context

capability: notion_search
entrypoints:
  - @kit/notion/api#createNotionSearchHandler
  - @kit/notion/ui/search-dialog
inputs:
  - query
  - content_type
outputs:
  - ranked_search_results
constraints:
  - search endpoint expects POST body schema
side_effects:
  - Notion query traffic

Agent Recipe

  1. Add search API route.
  2. Render SearchDialog with matching contentType.
  3. Validate keyboard shortcut and query behavior.

Troubleshooting

  • Empty results: verify content type key and indexed fields.
  • Request errors: validate request payload schema.

How is this guide?

Last updated on 3/23/2026