Svelte Hammer screenshot

Svelte Hammer

Author Avatar Theme by Beomy
Updated: 31 Jul 2021
24 Stars

Overview

This product is a Hammer.js wrapper for Svelte, designed to support certain operations on mobile devices. It functions as a directive in Svelte, making it easy to use Hammer.js within Svelte projects. The library requires Svelte version 3.0 or higher and Hammer.js version 2.x or higher.

Features

  • Pan Directives: Detect different pan events such as start, move, end, cancel, left, right, up, and down.
  • Pinch Directives: Detect different pinch events such as start, move, end, cancel, in, and out.
  • Press Directives: Detect press events such as press and press up.
  • Rotate Directives: Detect different rotate events such as start, move, end, and cancel.
  • Swipe Directives: Detect different swipe events such as left, right, up, and down.
  • Tap Directives: Detect tap events.

Installation

To install this library, you need to have Svelte version 3.0 or higher and Hammer.js version 2.x or higher. Use the following code snippets to install:

npm install svelte-hammerjs

Summary

This Svelte wrapper for Hammer.js provides an easy way to support mobile operations within Svelte projects. It offers a range of directives for detecting different gestures and events like pan, pinch, press, rotate, swipe, and tap. The library is easy to install and requires Svelte version 3.0 or higher and Hammer.js version 2.x or higher. It provides a convenient way to integrate Hammer.js functionality into Svelte projects.