@mixpeek/search-js is a drop-in React component that connects to any published Mixpeek retriever. It provides a full search UI with keyboard shortcuts, filters, AI answers, and streaming results — no backend code required on your side.
Quick Start
Set up your search backend
Use the docs search quickstart to provision a complete pipeline in one API call, or create a retriever manually and publish it.
Cmd+K (or Ctrl+K) to open the search modal. Results stream in from your retriever pipeline.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
projectKey | string | required | Published retriever slug or ret_sk_* API key |
placeholder | string | "Search..." | Input placeholder text |
maxResults | number | 10 | Maximum results to show |
theme | "light" | "dark" | "auto" | "auto" | Color theme |
accentColor | string | "#6366f1" | Accent color (hex) |
position | "modal" | "inline" | "modal" | Modal overlay or inline embed |
keyboardShortcut | boolean | true | Enable Cmd+K / Ctrl+K |
showPoweredBy | boolean | true | Show “Search by Mixpeek” badge |
enableAIAnswer | boolean | false | Show AI-generated answer with citations |
enableShareLinks | boolean | false | Enable shareable search URLs |
defaultOpen | boolean | false | Start with modal open |
defaultFilters | Record<string, unknown> | - | Default filter values on mount |
Callbacks
| Prop | Type | Description |
|---|---|---|
onSearch | (query: string) => void | Fires when a search is performed |
onResultClick | (result, index) => void | Fires when a result is clicked |
onZeroResults | (query: string) => void | Fires when no results are found |
onFilterChange | (filterInputs) => void | Fires when filters change |
transformResults | (results[]) => results[] | Transform results before rendering |
renderResult | (result, index) => ReactNode | Custom result renderer |
CDN Usage (No Build Step)
For sites without a build system, load the widget via CDN:Filters
The widget includes built-in filter components for facets, ranges, and LLM-powered smart filtering.Facet Filter
Single or multi-select dropdown:Range Filter
Numeric min/max slider:Smart Filter (LLM-based)
Natural language filtering powered by the retriever’s LLM filter stage:AI Answers
EnableenableAIAnswer to show an LLM-generated answer with citations above search results. This requires an agent_search or rag_prepare stage in your retriever.
Hooks
Access search state from any child component:useSearchKit, useSearch, useFilters, useKeyboardShortcut, useRecentSearches.
Setting Up the Backend
The widget needs a published retriever to connect to. There are two paths:Quickstart: Docs Search
Provision a complete search pipeline in one API call. This creates a namespace, bucket, collection (with web scraper + text embeddings), retriever, and published endpoint automatically:enable_code_search (default: true), enable_image_search (default: false), max_pages (default: 200), max_depth (default: 3).
Bootstrap CLI
The@mixpeek/react-searchkit package includes a CLI to scaffold a retriever with search, filter, and RAG stages:
feature_search, attribute_filter, and rag_prepare stages pre-configured.
Manual Setup
For full control, create each resource yourself:Create a namespace and bucket
Set up storage and enable the feature extractors you need (guide).
Create a collection
Configure a collection with a feature extractor (e.g.,
text_extractor, web_scraper, multimodal_extractor) and trigger processing on your data (guide).Create and publish a retriever
Build a retriever with the stages you need, then publish it to get a slug for the widget (guide).
Publishing a Retriever
Once you have a retriever, publish it to make it accessible to the widget:public_name becomes the projectKey you pass to the widget.
Authentication
The widget supports two authentication modes:| Mode | projectKey value | When to use |
|---|---|---|
| Public slug | "my-retriever-slug" | Public-facing search (no auth needed) |
| Scoped API key | "ret_sk_..." | Authenticated access with a retrieverSlug prop |
Examples
The search widget is used on mixpeek.com as the site-wide search in the navigation bar, powered by@mixpeek/search-js with the mixpeek-blog-search retriever slug.
Exported Components
For building fully custom search experiences, the package exports composable sub-components:| Component | Description |
|---|---|
SearchButton | Standalone search trigger button |
SearchModal | Search modal container |
SearchInput | Input field |
SearchResults | Results list |
ResultCard | Individual result card |
AIAnswer | AI-generated answer panel |
FilterPanel | Filter container |
FacetFilter | Select/multi-select filter |
RangeFilter | Min/max range slider |
SmartFilter | LLM-powered natural language filter |
PoweredBy | ”Search by Mixpeek” badge |
ShareLink | Shareable search URL generator |
ZeroResults | Empty state placeholder |
IntentCTA | Enterprise CTA capture |

