Fuzzy Component

Explore different configuration options for fuzzy search

Fields Property

Control which fields are displayed in search results

What are Fields?

The fields prop determines which properties from your data are shown in the results list. This is different from keys which controls what you search in.

In this example:

let fields = ['japanese', 'english']

Even though the data contains japanese, romaji, and english, only japanese and english will be displayed in the results.

💡 Tip: You can still search through all fields, but you'll only see the ones specified in fields.

Keys Property

Control which fields are searchable in your data

What are Keys?

The keys prop determines which properties in your data are searched. When you type in the search box, FuzzySearch only looks through the fields specified in keys.

In this example:

let keys = ['romaji', 'english']

Your search will only match text in the romaji and english fields. Searches won't match text in the japanese field.

🔍 Try it: Type "iku" (romaji) or "go" (english) to find results. Japanese characters won't work because japanese is not in the keys array.

Threshold Property

Set the initial fuzziness level for search matching

What is Threshold?

The thresholdValue prop controls how "fuzzy" the search is. It's a number between 0.0 (exact matches only) and 1.0 (very loose matching).

In this example:

thresholdValue=0.6

The search starts with moderate fuzziness (0.6), allowing for typos and partial matches.

Threshold Guide:

  • 0.0 - 0.2: Strict matching, minimal typos allowed
  • 0.3 - 0.5: Moderate fuzziness, some flexibility
  • 0.6 - 0.8: Loose matching, forgiving of mistakes
  • 0.9 - 1.0: Very loose, matches almost anything

🎯 Try it: Use the fuzziness slider to see how different thresholds affect your results. Lower values give more precise results, higher values cast a wider net.

Modular

modular, flexible architecture lets you build search experiences exactly the way you want. Choose your level of customization:

Headless Component

Composable

useFuzzySearch

Fuzzy Search Example

Lower values = more results (less strict matching)

Results (0)

Start typing to search...

Advanced

Advanced Fuzzy Search Example

Found 0 results
Start typing to search...
Click on a result to see details

Favorites (0)

No favorites yet

Single Object Data

FuzzySearch works with object dictionaries, not just arrays

What is a Single Object?

Instead of an array of objects, you can pass a single object where keys map to values. FuzzySearch automatically converts it into a searchable format.

Perfect for:

  • Dictionaries: Word definitions, glossaries
  • Translations: Key-value translation pairs
  • Configuration: Settings and their descriptions
  • Simple lookups: Any key-to-value mapping

Format: FuzzySearch converts {'key': 'value'} into [{'key': '...', 'value': '...'}, ...] automatically.

Sample data

    
{
  "abacus": "A counting device that uses beads on rods to perform arithmetic operations.",
  "amiable": "Having or displaying a friendly and pleasant manner.",
  "altruistic": "Showing a selfless concern for the well-being of others.",
  "benevolent": "Well-meaning and kindly."
  ...
}
    
  

Sample data

  
[
	{
		"japanese": "行く",
		"romaji": "iku",
		"english": "go"
	},
	{
		"japanese": "見る",
		"romaji": "miru",
		"english": "see, look at"
	},
	{
		"japanese": "多い",
		"romaji": "ooi",
		"english": "a lot of, many"
	},
	...
]