Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/lume/plugins/pagefind.ts>UIOptions

🔥 Static site generator for Deno 🦕
Very Popular
Latest
interface UIOptions
import { type UIOptions } from "https://deno.land/x/lume@v2.4.1/plugins/pagefind.ts";

Properties

optional
containerId: string

The container id to insert the search

optional
pageSize: number

The number of search results to load at once, before a “Load more” button is shown.

optional
showSubResults: boolean

Include results from page subsections (based on headings with IDs).

optional
showImages: boolean

Whether to show an image alongside each search result.

optional
excerptLength: number

The maximum number of characters to show in the excerpt. 0 means no limit

optional
processTerm: (term: string) => string

A function that Pagefind UI calls before performing a search. This can be used to normalize search terms to match your content.

optional
processResult: (result: unknown) => unknown

A function that Pagefind UI calls before displaying each result. This can be used to fix relative URLs, rewrite titles, or any other modifications you might like to make to the raw result object returned by Pagefind

optional
showEmptyFilters: boolean

By default, Pagefind UI shows filters with no results alongside the count (0). Pass false to hide filters that have no remaining results.

optional
openFilters: string[]

The default behavior of the filter display is to show values only when there is one filter with six or fewer values. When you include a filter name in openFilters it will open by default, regardless of the number of filters or values present.

optional
resetStyles: boolean

By default, Pagefind UI applies a CSS reset to itself. Pass false to omit this and inherit from your site styles.

optional
debounceTimeoutMs: number

The number of milliseconds to wait after a user stops typing before performing a search. If you wish to disable this, set to 0.

optional
translations: TranslationsOptions

A set of custom ui strings to use instead of the automatically detected language strings. See https://github.com/CloudCannon/pagefind/blob/main/pagefind_ui/translations/en.json for all available keys and initial values. The items in square brackets such as SEARCH_TERM will be substituted dynamically when the text is used.

optional
autofocus: boolean

Enabling autofocus automatically directs attention to the search input field for enhanced user convenience, particularly beneficial when the UI is loaded within a modal dialog. However, exercise caution, as using autofocus indiscriminately may pose potential accessibility challenges.

optional
sort: Record<string, "asc" | "desc">

Passes sort options to Pagefind for ranking. Note that using a sort will override all ranking by relevance.

optional
highlightParam: string

Enable the ability to highlight search terms on the result pages. Configure the query parameter name.