
Security News
GPT-6 Astra Attempts Supply Chain Attacks Against Open Source Maintainers in Testing
GPT-6 Astra hits 100% on ExploitBench and finds zero-days autonomously, while independent tests reveal scope violations and monitoring gaps.
@zachleat/pagefind-search
Advanced tools
Web Component to easily add the Pagefind search UI to your web site. This unlocks more control of asset loading via <is-land>.
<script type="module" src="pagefind-search.js"></script>
<!-- No fallback content (works, but not ideal) -->
<pagefind-search></pagefind-search>
<!-- Better: fallback to DuckDuckGo site search (use any search engine here) -->
<pagefind-search>
<form action="https://duckduckgo.com/" method="get" style="min-height: 3.2em;"><!-- min-height to reduce CLS -->
<label>
Search for:
<input type="search" name="q" autocomplete="off" autofocus>
</label>
<!-- Put your searchable domain here -->
<input type="hidden" name="sites" value="www.zachleat.com">
<button type="submit">Search</button>
</form>
</pagefind-search>
Any attribute that starts with an underscore will be passed to the Pagefind constructor as an option. Use underscore case for option names (as HTML attributes are case insensitive). This is only compatible with boolean/number/string options (but read on for a solution for the others below). Full options list on the Pagefind documentation.
_page_size for pageSize_show_sub_results for showSubResults_show_images for showImages_excerpt_length for excerptLengthprocessTermprocessResult_show_empty_filters for showEmptyFilters_reset_styles for resetStyles_bundle_path for bundlePath_debounce_timeout_ms for debounceTimeoutMstranslations<pagefind-search _show_images="false">
<!-- Don’t forget your fallback content! -->
</pagefind-search>
Use the manual attribute to manually initialize your Pagefind UI with any custom options (including functions, objects, etc).
<pagefind-search manual id="my-search">
<!-- Don’t forget your fallback content! -->
</pagefind-search>
<script type="module">
let el = document.querySelector("#my-search");
await el.pagefind({
showImages: false,
debounceTimeoutMs: 100,
processTerm: function (term) {
return term.replace(/aa/g, 'ā');
}
});
// Use `el.pagefindUI` to access the PagefindUI instance
</script>
Use <is-land> to enable more control over the component’s downstream asset loading.
<script type="module" src="pagefind-search.js"></script>
<!-- Use any of is-land’s on: conditions -->
<is-land on:idle on:visible on:media="(min-width: 40em)" on:save-data="false">
<pagefind-search>
<!-- Don’t forget your fallback content! -->
</pagefind-search>
</is-land>
If search is a secondary feature on a page, you could lazy load the component definition too, though that would chain two separate JavaScript file loads together which is probably not what you want:
<!-- Use any of is-land’s on: conditions -->
<is-land on:idle on:visible on:media="(min-width: 40em)" on:save-data="false">
<pagefind-search>
<!-- Don’t forget your fallback content! -->
</pagefind-search>
<template data-island>
<script type="module" src="pagefind-search.js"></script>
</template>
</is-land>
You can optionally load the Pagefind CSS yourself! This is useful if Search is a primary use case for the page and loads the 3 kB (compressed) Stylesheet up front but will still allow lazy loading the 20 kB (compressed) JavaScript file via <is-land>.
<link rel="stylesheet" href="/pagefind/pagefind-ui.css">
<script type="module" src="pagefind-search.js"></script>
pagefind-autofocus to focus on the form element after pagefind has initialized.manual for manual initialization.FAQs
A web component to search with Pagefind.
The npm package @zachleat/pagefind-search receives a total of 19 weekly downloads. As such, @zachleat/pagefind-search popularity was classified as not popular.
We found that @zachleat/pagefind-search demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.

Security News
GPT-6 Astra hits 100% on ExploitBench and finds zero-days autonomously, while independent tests reveal scope violations and monitoring gaps.

Product
Socket can now send alerts and supply chain attack notifications to Microsoft Teams, with filters that route the right updates to each channel.

Security News
pnpm 12 rewrites the package manager in Rust, cutting install times by up to 90% while preserving pnpm 11 workflows and lockfiles.