New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@sveltejs/gestures

Package Overview
Dependencies
Maintainers
2
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sveltejs/gestures

Svelte actions for cross-platform gesture detection

  • 0.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
2
Created
Source

@sveltejs/gestures

A (work-in-progress) collection of gestures recognisers for Svelte components.

Each recogniser is implemented as an action that emits custom events. Pointer events are used where possible, falling back to mouse and touch events.

tap

This action fires a tap event when the user taps on an element with either a mouse or a finger (or other pointing device). If the pointer is down for more than 300ms, it doesn't count, unlike with click events.

Pressing the spacebar on a focused button will also fire a tap event. Taps on disabled form elements are disregarded.

The event.detail object has x and y properties corresponding to clientX and clientY. If the original event was a spacebar keypress, both are null.

<script>
	import { tap } from '@sveltejs/gestures';

	function handler(event) {
		console.log(`the button was tapped at ${event.detail.x}, ${event.detail.y}`);
	}
</script>

<button use:tap on:tap={handler}>
	tap the button
</button>

TODO: pan, swipe, rotate, pinch, press

License

LIL

FAQs

Package last updated on 05 Mar 2019

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc