pagefind_ui/component/README.md
Modular web components for Pagefind search.
npm install @pagefind/component-ui
Import the components and styles:
import '@pagefind/component-ui';
import '@pagefind/component-ui/css';
If your bundler doesn't support the /css export, import the CSS file directly:
import '@pagefind/component-ui/css/pagefind-component-ui.css';
After running Pagefind, include the generated files from your output directory:
<link href="/pagefind/pagefind-component-ui.css" rel="stylesheet">
<script src="/pagefind/pagefind-component-ui.js" type="module"></script>
Add a modal search to your site:
<pagefind-modal-trigger></pagefind-modal-trigger>
<pagefind-modal></pagefind-modal>
Or use a searchbox dropdown:
<pagefind-searchbox></pagefind-searchbox>
Or build your own layout with individual components:
<pagefind-input></pagefind-input>
<pagefind-summary></pagefind-summary>
<pagefind-results></pagefind-results>
For full documentation, component references, styling guides, and examples, visit:
MIT