1.0.3-remake • Published 2 years ago

svelte-taphold v1.0.3-remake

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Svelte Tap Hold

Minimalistic tap and hold component for Svelte/SvelteKit.

Installation

// Using Yarn to install
yarn add --dev svelte-taphold

// or if you prefer NPM
npm install --save-dev svelte-taphold

Usage Sample

<script>
  import { taphold } from 'svelte-taphold'

  let ticks = 0 // show how many ticks button has been hold
  let interval = 100

  const onTapHold = () => ticks++
  const reset = () => ticks = 0
</script>

<h1>Tap and Hold {ticks}x</h1>
<label for="interval">Interval</label>
<input
  id="interval"
  placeholder="interval"
  bind:value={interval}
  type="number"/>

<!-- svelte-taphold on button -->
<button
  use:taphold={interval}
  on:taphold={onTapHold} >
  Tap and Hold
</button>

<button on:click={reset}>Reset Iteration</button>
1.0.3-remake

2 years ago

1.0.2

2 years ago

1.0.3-keywords

2 years ago

1.0.3

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago