The Search component for Quartz - full-text search with FlexSearch integration.
- 🔍 Full-Text Search - Search across all your content instantly
- ⚡ Fast Indexing - Uses FlexSearch for high-performance search
- 📱 Mobile Responsive - Works great on all devices
- 🎯 Search Preview - Optional content preview panel
- 🌐 Multi-Language - Supports 30+ locales
- ⌨️ Keyboard Shortcuts -
Ctrl/Cmd + Kto open,Escapeto close - 🏷️ Tag Search - Search by tags with special syntax
npx quartz plugin add github:quartz-community/searchplugins:
- source: github:quartz-community/search
enabled: true
layout:
position: left
priority: 20
group: toolbar
groupOptions:
grow: trueFor advanced use cases, you can override in TypeScript:
import * as ExternalPlugin from "./.quartz/plugins";
ExternalPlugin.Search({
enablePreview: true,
placeholder: "Search for something",
title: "Search",
});interface SearchOptions {
/** Enable content preview panel */
enablePreview?: boolean;
/** Custom placeholder text */
placeholder?: string;
/** Custom title for the search button */
title?: string;
}By default, the search component:
- Displays as a button with a search icon
- Opens a fullscreen search modal when clicked
- Shows up to 8 search results
- Enables content preview on desktop (can be disabled)
- Supports keyboard navigation (arrow keys, Enter, Escape)
- Uses FlexSearch from CDN for indexing
The Search component:
- Loads FlexSearch library from CDN when initialized
- Fetches content data via the
fetchDataglobal (resolvescontentIndex.jsonwith the correct base path) - Builds a search index from your content
- Performs real-time search as you type
- Shows results with optional content preview
[!info] Search requires the
ContentIndexemitter plugin to be present in your Quartz configuration.
Ctrl/Cmd + K- Open/Close searchEscape- Close searchArrow Up/Down- Navigate resultsEnter- Open selected result
This is a first-party Quartz community plugin. It serves as both:
- A production-ready Search component
- A reference implementation for building Quartz community plugins
To build locally:
npm install
npm run buildThe prepare script automatically builds during installation.
See the Quartz documentation for more information.
MIT