@svelte-put/shortcut
Svelte action use:shortcut
- add event listener for keyboard shortcuts
Table of Contents
Show / hide
svelte-put
This package is part of the @svelte-put family. For contributing guideline and more, refer to its readme.
Installation
npm install -D @svelte-put/shortcut
yarn add -D @svelte-put/shortcut
pnpm add -D @svelte-put/shortcut
Usage
See examples here
Documentation
Typescript support
app.d.ts: show / hide
declare namespace svelte.JSX {
interface HTMLAttributes<T> {
onshortcut?: (event: CustomEvent<import('@svelte-put/shortcut').ShortcutEventDetails>) => void;
}
}
For detailed documentation, see the extracted API.
Quick access to the parameter interface accepted by the action: ShortcutParameters.