{"id":13422385,"url":"https://github.com/voronianski/react-swipe","last_synced_at":"2025-05-14T13:07:26.155Z","repository":{"id":19253454,"uuid":"22489112","full_name":"voronianski/react-swipe","owner":"voronianski","description":":left_right_arrow: Swipe.js as a React component","archived":false,"fork":false,"pushed_at":"2022-03-22T17:07:35.000Z","size":1809,"stargazers_count":1661,"open_issues_count":14,"forks_count":256,"subscribers_count":24,"default_branch":"gh-pages","last_synced_at":"2025-05-07T15:47:47.011Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://voronianski.github.io/react-swipe/demo?continuous=true","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/voronianski.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-07-31T23:44:27.000Z","updated_at":"2025-04-30T09:29:25.000Z","dependencies_parsed_at":"2022-08-01T04:37:56.724Z","dependency_job_id":null,"html_url":"https://github.com/voronianski/react-swipe","commit_stats":null,"previous_names":[],"tags_count":36,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/voronianski%2Freact-swipe","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/voronianski%2Freact-swipe/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/voronianski%2Freact-swipe/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/voronianski%2Freact-swipe/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/voronianski","download_url":"https://codeload.github.com/voronianski/react-swipe/tar.gz/refs/heads/gh-pages","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254149958,"owners_count":22022851,"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-07-30T23:00:43.422Z","updated_at":"2025-05-14T13:07:21.126Z","avatar_url":"https://github.com/voronianski.png","language":"JavaScript","funding_links":["https://www.buymeacoffee.com/voronianski"],"categories":["UI Utilities","Uncategorized","UI Components","UI Utilites","JavaScript"],"sub_categories":["Device Input","Uncategorized","Device Input/User Action"],"readme":"# react-swipe\n\n[![build status](http://img.shields.io/travis/voronianski/react-swipe.svg?style=flat)](https://travis-ci.org/voronianski/react-swipe)\n[![npm version](http://badge.fury.io/js/react-swipe.svg)](http://badge.fury.io/js/react-swipe)\n[![Download Count](http://img.shields.io/npm/dm/react-swipe.svg?style=flat)](http://www.npmjs.com/package/react-swipe)\n\u003ca href=\"https://www.buymeacoffee.com/voronianski\" target=\"_blank\"\u003e\u003cimg src=\"https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png\" height=\"20\" alt=\"Buy Me A Coffee\" style=\"height: auto !important;width: auto !important;\" \u003e\u003c/a\u003e\n\n\u003e [Brad Birdsall](https://github.com/thebird)'s [Swipe.js](https://github.com/voronianski/swipe-js-iso) as a [React](http://facebook.github.io/react) component.\n\n## Demo\n\nCheck out the [demo](http://voronianski.github.io/react-swipe/demo/) from a mobile device (real or emulated).\n\n\u003cimg src=\"https://user-images.githubusercontent.com/974035/34205307-30965ccc-e582-11e7-9384-fe1ce991ff4f.gif\" width=\"600\" /\u003e\n\n## Install\n\n```bash\nnpm install react swipe-js-iso react-swipe --save\n```\n\n## Usage\n\n### Examples\n\n```javascript\nimport React from 'react';\nimport ReactDOM from 'react-dom';\nimport ReactSwipe from 'react-swipe';\n\nconst Carousel = () =\u003e {\n  let reactSwipeEl;\n\n  return (\n    \u003cdiv\u003e\n      \u003cReactSwipe\n        className=\"carousel\"\n        swipeOptions={{ continuous: false }}\n        ref={el =\u003e (reactSwipeEl = el)}\n      \u003e\n        \u003cdiv\u003ePANE 1\u003c/div\u003e\n        \u003cdiv\u003ePANE 2\u003c/div\u003e\n        \u003cdiv\u003ePANE 3\u003c/div\u003e\n      \u003c/ReactSwipe\u003e\n      \u003cbutton onClick={() =\u003e reactSwipeEl.next()}\u003eNext\u003c/button\u003e\n      \u003cbutton onClick={() =\u003e reactSwipeEl.prev()}\u003ePrevious\u003c/button\u003e\n    \u003c/div\u003e\n  );\n};\n\nReactDOM.render(\u003cCarousel /\u003e, document.getElementById('app'));\n```\n\n### Props\n\n- `swipeOptions: ?Object` - supports all original options from [Swipe.js config](https://github.com/voronianski/swipe-js-iso#config-options). If passed object differs from the previous one `react-swipe` will re-initiate underlying Swipe.js instance with fresh options\n\n- `style: ?Object` - object with 3 keys (see [defaults](https://github.com/voronianski/react-swipe/blob/gh-pages/src/index.js#L28)):\n\n  - `container: ?Object`\n  - `wrapper: ?Object`\n  - `child: ?Object`\n\n- regular props as `className`, `id` for root component are also supported\n\n- `childCount: ?Number` - use it to explicitely tell `react-swipe` that it needs to re-initiate underlying Swipe.js instance. For example, by setting the `childCount` prop to the `length` of the images array that you pass into `react-swipe`, re-rendering will take place when the `images.length` differs from the previous `render` pass:\n\n```js\n\u003cReactSwipe childCount={images.length}\u003e{images}\u003c/ReactSwipe\u003e\n```\n\n## Methods\n\nComponent proxies all [Swipe.js instance methods](https://github.com/voronianski/swipe-js-iso/#swipe-api).\n\n### Playground\n\nConfigure the ReactSwipe component in a sandbox environment at [CodeSandbox](https://codesandbox.io/s/q86m8n9qnj).\n\n---\n\n**MIT Licensed**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvoronianski%2Freact-swipe","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvoronianski%2Freact-swipe","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvoronianski%2Freact-swipe/lists"}