
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
fuzzyfilter-react
Advanced tools
React hook for FuzzyFilter - build intelligent filter interfaces with fuzzy matching and type-aware suggestions.
bun add fuzzyfilter fuzzyfilter-react
import { useFuzzyFilter } from "fuzzyfilter-react";
import { createFuzzyFilter, column Id } from "@jasperhino/fuzzyfilter";
// Create and configure filter
const filter = createFuzzyFilter();
filter.setSchema({
columns: [
{ id: columnId("status"), name: "Status", type: "enum", values: ["Open", "Closed"] },
{ id: columnId("priority"), name: "Priority", type: "number" },
{ id: columnId("assignee"), name: "Assignee", type: "string" },
],
});
filter.indexData(myData);
function FilterInput() {
const {
query,
setQuery,
suggestions,
isLoading,
selectedIndex,
navigateSuggestions,
applySuggestion,
} = useFuzzyFilter(filter);
return (
<div>
<input
value={query}
onChange={(e) => setQuery(e.target.value)}
onKeyDown={(e) => {
if (e.key === "ArrowDown") {
e.preventDefault();
navigateSuggestions("down");
}
if (e.key === "ArrowUp") {
e.preventDefault();
navigateSuggestions("up");
}
if (e.key === "Enter") {
applySuggestion();
}
}}
placeholder="Filter..."
/>
{isLoading && <span>Loading...</span>}
<ul>
{suggestions.map((suggestion, index) => (
<li
key={suggestion.id}
className={index === selectedIndex ? "selected" : ""}
>
{suggestion.label} ({suggestion.resultCount} results)
</li>
))}
</ul>
</div>
);
}
When building filter interfaces with multiple stacked filters, pass the compiled filters as context to get accurate result counts:
import { useState } from "react";
import { useFuzzyFilter } from "fuzzyfilter-react";
import type { CompiledFilter } from "@jasperhino/fuzzyfilter";
function MultiFilterInput() {
const [appliedFilters, setAppliedFilters] = useState<CompiledFilter[]>([]);
const { query, setQuery, suggestions } = useFuzzyFilter(filter, {
filterContext: appliedFilters,
onApply: (suggestion) => {
// Compile and add the filter
const compiled = filter.compileFilter(
suggestion.column.id,
suggestion.operator,
suggestion.value?.value
);
if (compiled) {
setAppliedFilters((prev) => [...prev, compiled]);
}
},
});
// Suggestion counts now reflect only rows matching all applied filters
return (
<div>
{/* Applied filter badges */}
{appliedFilters.map((f, i) => (
<span key={i}>{f.expression}</span>
))}
{/* Input and suggestions */}
<input value={query} onChange={(e) => setQuery(e.target.value)} />
<ul>
{suggestions.map((s) => (
<li key={s.id}>{s.label} ({s.resultCount})</li>
))}
</ul>
</div>
);
}
useFuzzyFilter(filter, options?)filter: FuzzyFilter - The FuzzyFilter instanceoptions.debounceMs?: number - Debounce delay in ms (default: 150)options.initialQuery?: string - Initial query stringoptions.onApply?: (suggestion) => void - Callback when a suggestion is appliedoptions.filterContext?: CompiledFilter[] - Already-applied filters for stacked countingquery: string - Current query valuesuggestions: FilterSuggestion[] - Current suggestionsisLoading: boolean - Loading stateerror: Error | null - Error stateselectedIndex: number - Currently selected suggestion indexselectedSuggestion: FilterSuggestion | null - Currently selected suggestionsetQuery(query: string) - Set the query valueselectSuggestion(index: number) - Select a suggestion by indexnavigateSuggestions(direction: "up" | "down") - Navigate suggestionsapplySuggestion() - Apply the selected suggestionreset() - Reset all stateFAQs
React hook for FuzzyFilter
The npm package fuzzyfilter-react receives a total of 0 weekly downloads. As such, fuzzyfilter-react popularity was classified as not popular.
We found that fuzzyfilter-react demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.