<pagefind-filter-dropdown>

A dropdown selector for a single filter.

<pagefind-filter-dropdown filter="section" label="Section"></pagefind-filter-dropdown>

Attributes

AttributeTypeDefaultDescription
filterstringRequired. The filter key to display
labelstringfilter nameText shown on the trigger button
single-selectbooleanfalseAllow only one selection (closes after selecting)
show-emptybooleanfalseShow options with zero results
wrapbooleanfalseAllow text to wrap to multiple lines
sortstring"default"Sort filter values: default, alphabetical, count-desc, count-asc
hide-clearbooleanfalseHide the adjacent “Clear” button
instancestring"default"Connect to a specific Pagefind instance

Keyboard Navigation

Full keyboard support following the ARIA Listbox pattern:

KeyAction
/ Navigate through options
Home / EndJump to first/last option
Enter / SpaceToggle selection
EscapeClose dropdown
TabClose and move focus
Type charactersJump to matching option (type-ahead)

Type-Ahead Behavior

When you type characters while the dropdown is open:

  • The component jumps to the first option that starts with the typed characters
  • Matching is case-insensitive
  • The type buffer clears after 500ms of inactivity

Faceted Search Mode

For catalog-style interfaces where users browse by filters without requiring a search term, enable faceted mode via <pagefind-config>:

<pagefind-config faceted preload></pagefind-config>

In faceted mode, all results are shown initially and update immediately when filters are changed. See the config component documentation for details.

Components