Get unlimited public & private packages + team-based management with npm Teams.Learn more »

svelte-fuzzy

0.2.1 • Public • Published

svelte-fuzzy

NPM Build Coverage

Lightweight Svelte fuzzy search highlighting using fuse.js.

Install

yarn add svelte-fuzzy

Usage

<script>
  import SvelteFuzzy from 'svelte-fuzzy';
</script> 
 
<SvelteFuzzy
  query='old'
  data={[{ title: "Old Man's War" }, { title: 'The Lock Artist' }, { title: 'HTML5' }]}
  options={{ keys: ['title'] }}
  let:result>
  {#each result as { title }}
    {#each title as { text, matches }}
      {#if matches}
        <mark>{text}</mark>
      {:else}{text}{/if}
    {/each}
  {/each}
</SvelteFuzzy>

Changelog

License

MIT

Install

npm i svelte-fuzzy

DownloadsWeekly Downloads

5

Version

0.2.1

License

MIT

Unpacked Size

21.1 kB

Total Files

19

Last publish

Collaborators

  • avatar