
Product
Introducing Repository Access Permissions and Custom Roles
Socket now supports Custom Roles and Repository Access Permissions so organizations can control who can access specific repositories and actions.
svelte-fuzzy
Advanced tools
Fuse.js binding for fuzzy text match highlighting.
Yarn
yarn add -D svelte-fuzzy
NPM
npm i -D svelte-fuzzy
<script>
import Fuzzy from "svelte-fuzzy";
let query = "old";
// Fuse.js options
let options = { keys: ["title"] };
// Fuse.js data
let data = [
{
title: "Frankenstein; Or, The Modern Prometheus",
author: "Mary Wollstonecraft Shelley",
},
{
title: "A Christmas Carol in Prose; Being a Ghost Story of Christmas",
author: "Charles Dickens",
},
{ title: "Pride and Prejudice", author: "Jane Austen" },
{ title: "The Scarlet Letter", author: "Nathaniel Hawthorne" },
{ title: "Alice's Adventures in Wonderland", author: "Lewis Carroll" },
];
let formatted = [];
</script>
<input bind:value={query} />
<br />
<button on:click={() => (query = "carol")}>Search "carol"</button>
<button on:click={() => (query = "")}>Clear</button>
<Fuzzy {query} {data} {options} bind:formatted />
{#each formatted as item}
{#each item as line}
<li>
{#each line as { matches, text }}
{#if matches}
<mark>{text}</mark>
{:else}
{text}
{/if}
{/each}
</li>
{/each}
{/each}
HighlighterYou can use the Highlighter component for fuzzy text highlighting. Matching characters are wrapped in a mark element.
<script>
import { Highlighter } from "svelte-fuzzy";
</script>
{#each formatted as item}
{#each item as line}
<li>
<Highlighter {line} />
</li>
{/each}
{/each}
Fuzzy| Prop name | Value |
|---|---|
| query | string (default: "") |
| data | FuzzyData (default: []) |
| options | FuzzyOptions |
| result | FuzzyResult (default: []) |
| formatted | FuzzyFormattedResult (default: []) |
Highlighter| Prop name | Value |
|---|---|
| line | HighlighterLine (default: []) |
Svelte version 3.31 or greater is required to use this component with TypeScript.
TypeScript definitions are located in the types folder.
FAQs
Fuse.js binding for fuzzy text match highlighting.
The npm package svelte-fuzzy receives a total of 49 weekly downloads. As such, svelte-fuzzy popularity was classified as not popular.
We found that svelte-fuzzy demonstrated a not healthy version release cadence and project activity because the last version was released 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.

Product
Socket now supports Custom Roles and Repository Access Permissions so organizations can control who can access specific repositories and actions.

Product
Socket MCP now lets AI assistants review org alerts, investigate threats using the Socket threat feed, and inspect package files in addition to dependency scoring.

Product
Socket Firewall blocks malicious VS Code and Open VSX extensions before install, protecting developers from compromised editor marketplaces.