{"id":16888152,"url":"https://github.com/leandrowd/react-easy-swipe","last_synced_at":"2025-05-15T04:07:45.488Z","repository":{"id":38290552,"uuid":"49120455","full_name":"leandrowd/react-easy-swipe","owner":"leandrowd","description":"Easy handler for common swipe operations","archived":false,"fork":false,"pushed_at":"2025-03-03T09:59:40.000Z","size":339,"stargazers_count":104,"open_issues_count":1,"forks_count":32,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-05-04T08:03:31.782Z","etag":null,"topics":["mobile","mouse","react","react-component","swipe","touch"],"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/leandrowd.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-01-06T07:35:31.000Z","updated_at":"2024-05-14T08:59:42.000Z","dependencies_parsed_at":"2024-04-21T01:45:05.103Z","dependency_job_id":"4b87cef0-80db-4caf-b842-2c00221a82f0","html_url":"https://github.com/leandrowd/react-easy-swipe","commit_stats":{"total_commits":97,"total_committers":18,"mean_commits":5.388888888888889,"dds":0.5051546391752577,"last_synced_commit":"65b9a3c5f4acc2fc8c2abf00c3c963cf52873b29"},"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leandrowd%2Freact-easy-swipe","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leandrowd%2Freact-easy-swipe/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leandrowd%2Freact-easy-swipe/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leandrowd%2Freact-easy-swipe/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/leandrowd","download_url":"https://codeload.github.com/leandrowd/react-easy-swipe/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254270656,"owners_count":22042860,"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":["mobile","mouse","react","react-component","swipe","touch"],"created_at":"2024-10-13T16:49:30.137Z","updated_at":"2025-05-15T04:07:40.458Z","avatar_url":"https://github.com/leandrowd.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# REACT EASY SWIPE\n[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fleandrowd%2Freact-easy-swipe.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2Fleandrowd%2Freact-easy-swipe?ref=badge_shield)\n\n\nAdd swipe interactions to your react component.\n* Generated using [react-init](https://www.npmjs.com/package/react-init)\n\n## Demo\n[http://leandrowd.github.io/react-easy-swipe/](http://leandrowd.github.io/react-easy-swipe/)\n- Open your console;\n- Swipe over the content and check your console;\n- This is a touch component so make sure your browser is emulating touch.\n\n## Tips:\n\n1) To prevent scroll during swipe, return true from the handler passed to onSwipeMove\n\n2) To allow mouse events to behave like touch, pass a prop allowMouseEvents\n\n3) To prevent accidental swipes on scroll, pass a prop tolerance with the tolerance pixel as number.\n\n## Instalation\n`npm install react-easy-swipe --save`\n\n\n## Usage\n```javascript\nimport React, {Component} from 'react';\nimport ReactDOM from 'react-dom';\nimport Swipe from 'react-easy-swipe';\n\nclass MyComponent extends Component {\n  onSwipeStart(event) {\n    console.log('Start swiping...', event);\n  }\n\n  onSwipeMove(position, event) {\n    console.log(`Moved ${position.x} pixels horizontally`, event);\n    console.log(`Moved ${position.y} pixels vertically`, event);\n  }\n\n  onSwipeEnd(event) {\n    console.log('End swiping...', event);\n  }\n\n  render() {\n    const boxStyle = {\n      width: '100%',\n      height: '300px',\n      border: '1px solid black',\n      background: '#ccc',\n      padding: '20px',\n      fontSize: '3em'\n    };\n\n    return (\n      \u003cSwipe\n        onSwipeStart={this.onSwipeStart}\n        onSwipeMove={this.onSwipeMove}\n        onSwipeEnd={this.onSwipeEnd}\u003e\n          \u003cdiv style={boxStyle}\u003eOpen the console and swipe me\u003c/div\u003e\n      \u003c/Swipe\u003e\n    );\n  }\n}\n\nReactDOM.render(\u003cMyComponent/\u003e, document.getElementById('root'));\n\n```\n\n## Properties\n\n```javascript\n{\n  tagName: PropTypes.string,\n  className: PropTypes.string,\n  style: PropTypes.object,\n  children: PropTypes.node,\n  allowMouseEvents: PropTypes.bool,\n  onSwipeUp: PropTypes.func,\n  onSwipeDown: PropTypes.func,\n  onSwipeLeft: PropTypes.func,\n  onSwipeRight: PropTypes.func,\n  onSwipeStart: PropTypes.func,\n  onSwipeMove: PropTypes.func,\n  onSwipeEnd: PropTypes.func,\n  tolerance: PropTypes.number.isRequired\n}\n```\n\n## Contributing\n\nPlease, feel free to contribute. You may open a bug, request a feature, submit a pull request or whatever you want!\n\n\n## License\n[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fleandrowd%2Freact-easy-swipe.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Fleandrowd%2Freact-easy-swipe?ref=badge_large)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleandrowd%2Freact-easy-swipe","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fleandrowd%2Freact-easy-swipe","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleandrowd%2Freact-easy-swipe/lists"}