svelte-actions-keydown Svelte Themes

Svelte Actions Keydown

svelte-actions-keydown

Keydown events action plugin for Svelte 3. Demo

Usage

Install with npm or yarn:

npm install --save svelte-actions-keydown
<svelte:window on:enter={submit} on:esc={cancel} />

<script>
  import { enter, esc } from 'svelte-actions-keydown';

  function submit() {
    alert('Enter pressed');
  }

  function cancel() {
    alert('Esc pressed');
  }
</script>

License

MIT © PaulMaly

Top categories

Loading Svelte Themes