{"id":15621985,"url":"https://github.com/jedwatson/react-hammerjs","last_synced_at":"2025-05-15T00:09:49.420Z","repository":{"id":23262737,"uuid":"26621074","full_name":"JedWatson/react-hammerjs","owner":"JedWatson","description":"ReactJS / HammerJS integration. Support touch events in your React app.","archived":false,"fork":false,"pushed_at":"2021-07-18T10:43:08.000Z","size":557,"stargazers_count":935,"open_issues_count":49,"forks_count":129,"subscribers_count":22,"default_branch":"master","last_synced_at":"2025-05-13T21:51:06.447Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JedWatson.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-11-14T03:42:48.000Z","updated_at":"2025-04-26T21:23:00.000Z","dependencies_parsed_at":"2022-08-30T20:00:55.764Z","dependency_job_id":null,"html_url":"https://github.com/JedWatson/react-hammerjs","commit_stats":null,"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JedWatson%2Freact-hammerjs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JedWatson%2Freact-hammerjs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JedWatson%2Freact-hammerjs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JedWatson%2Freact-hammerjs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JedWatson","download_url":"https://codeload.github.com/JedWatson/react-hammerjs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254249206,"owners_count":22039029,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-03T09:52:29.912Z","updated_at":"2025-05-15T00:09:44.403Z","avatar_url":"https://github.com/JedWatson.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"React-HammerJS\n==============\n\n[ReactJS](http://facebook.github.io/react/) / [HammerJS](http://hammerjs.github.io) integration. Support touch events in your React app.\n\nIf you're looking for native tap event handling in ReactJS, check out my [react-tappable](https://github.com/JedWatson/react-tappable) package.\n\n\n## Installation\n\nThe easiest way to use React-HammerJS is to install it from NPM and include it in your own React build process (using [Browserify](http://browserify.org), etc).\n\nYou can also use the standalone build by including `dist/hammer.js` in your page. If you use this, make sure you have already included React, and it is available as a global variable.\n\n```\nnpm install react-hammerjs --save\n```\n\n\n## Usage\n\nReact-HammerJS wraps a React component, binding Hammer events to it so it can fire the handlers specified.\n\n## Properties\n\n### Event Listener properties\n* `onTap`\n* `onDoubleTap`\n* `onPan`\n* `onPanCancel`\n* `onPanEnd`\n* `onPanStart`\n* `onPinch`\n* `onPinchCancel`\n* `onPinchEnd`\n* `onPinchIn`\n* `onPinchOut`\n* `onPinchStart`\n* `onPress`\n* `onPressUp`\n* `onRotate`\n* `onRotateCancel`\n* `onRotateEnd`\n* `onRotateMove`\n* `onRotateStart`\n* `onSwipe`\n* `action` - like the `onTap` event handler but will also be fired `onPress`.\n\n### Behavior properties\n* `direction` - (string) `'DIRECTION_ALL'` | `'DIRECTION_HORIZONTAL'` | `'DIRECTION_VERTICAL'`.  Used to restrict the `pan` and `swipe` direction. These string values may also work: `'DIRECTION_NONE'` |`'DIRECTION_LEFT'` | `'DIRECTION_RIGHT'` | `'DIRECTION_UP'` | `'DIRECTION_DOWN'`.\n\n* `options` - can be used to configure the Hammer manager. These properties will be merged with the default ones.\n\n### Example\n\n```\nvar Hammer = require('react-hammerjs');\n\n// Default options\n\u003cHammer onTap={handleTap} onSwipe={handleSwipe}\u003e\u003cdiv\u003eTap Me\u003c/div\u003e\u003c/Hammer\u003e\n\n// Custom options\nvar options = {\n    touchAction:'compute',\n    recognizers: {\n        tap: {\n            time: 600,\n            threshold: 100\n        }\n    }\n};\n\n\u003cHammer onTap={handleTap} options={options}\u003e\u003cdiv\u003eTap Me\u003c/div\u003e\u003c/Hammer\u003e\n```\n\n# Disabled Events\n\nAs a default, the `pinch` and `rotate` events are disabled in hammer.js, as they would make actions on an element \"blocking\". You may enable these events using the options object which is a attribute on the react `\u003cHammer\u003e` element.\n\nFor example, to activate the `pinch` event on a `canvas` element:\n\n```\n\u003cHammer\n    onPinch={handlePinch}\n    options={{\n       recognizers: {\n          pinch: { enable: true }\n       }\n    }}\u003e\n    \u003ccanvas\u003e\u003c/canvas\u003e\n\u003c/Hammer\u003e\n```\n\nDisabled events are detailed in the hammer.js api documentation:\n- http://hammerjs.github.io/recognizer-rotate/\n- http://hammerjs.github.io/recognizer-pinch/\n\n# License\n\nMIT Licensed. Copyright (c) Jed Watson 2017.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjedwatson%2Freact-hammerjs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjedwatson%2Freact-hammerjs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjedwatson%2Freact-hammerjs/lists"}