Search & filtering

Filter the item list by query. Default is Fuse.js with weighted keys and a threshold. You can customize Fuse, replace it with a custom filter, or control results entirely from outside.

Default Fuse.js behavior

Out of the box, filtering uses Fuse.js. Weighted keys: label (e.g. 0.7), keywords (0.5), description (0.3). Threshold around 0.4 for typo tolerance. maxResults caps how many items are rendered while Fuse ranks the full set.

Customizing Fuse.js

Pass filterOptions to the menu (or to createFilter): threshold, keys, etc. Same options as Fuse.js constructor.

Custom filter function

Pass a filter function that takes (items, query) and returns filtered items (or grouped result). You can implement prefix match, exact match, or call an API and return sync results. Set filter: false to disable filtering (show all items).

Controlled results

Use filteredItems + onQueryChange. The caller owns filtering entirely; the menu just renders what you pass. Good for search-as-you-type against an API.

Demos

Default fuzzy search (typo-tolerant, weighted). Custom threshold/keys. Custom filter (non-Fuse). Controlled results with external filtering. See Storybook for interactive examples.