{"id":13720480,"url":"https://github.com/jshanson7/react-native-swipeable","last_synced_at":"2025-05-14T19:02:45.718Z","repository":{"id":38240410,"uuid":"78069783","full_name":"jshanson7/react-native-swipeable","owner":"jshanson7","description":"A powerful React Native swipe component.","archived":false,"fork":false,"pushed_at":"2024-05-10T19:32:36.000Z","size":7224,"stargazers_count":1241,"open_issues_count":97,"forks_count":275,"subscribers_count":22,"default_branch":"master","last_synced_at":"2025-05-05T20:04:00.253Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/jshanson7.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":"2017-01-05T02:04:12.000Z","updated_at":"2025-03-12T05:57:09.000Z","dependencies_parsed_at":"2024-06-18T12:26:05.433Z","dependency_job_id":"30d0177c-7325-46d2-8ba9-a4561f83f507","html_url":"https://github.com/jshanson7/react-native-swipeable","commit_stats":{"total_commits":57,"total_committers":7,"mean_commits":8.142857142857142,"dds":"0.29824561403508776","last_synced_commit":"381ecc3fe2e1f11599c440f7b8d27137c1dc8ff3"},"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jshanson7%2Freact-native-swipeable","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jshanson7%2Freact-native-swipeable/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jshanson7%2Freact-native-swipeable/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jshanson7%2Freact-native-swipeable/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jshanson7","download_url":"https://codeload.github.com/jshanson7/react-native-swipeable/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253471139,"owners_count":21913801,"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-08-03T01:01:04.233Z","updated_at":"2025-05-14T19:02:45.662Z","avatar_url":"https://github.com/jshanson7.png","language":"JavaScript","funding_links":[],"categories":["JavaScript","Components"],"sub_categories":["List"],"readme":"# React Native Swipeable [![NPM version][npm-image]][npm-url]\n\nA powerful React Native swipe component.  Supports both iOS and Android.\n\n\u003cimg src=\"https://raw.githubusercontent.com/jshanson7/react-native-swipeable/master/demo.gif\" width=\"310\"\u003e\n\n## Installation\n\n```sh\nnpm i --save react-native-swipeable\n```\n\n## Usage\n\nWrap your ListView/TableView items with the `Swipeable` component:\n\n```javascript\nimport Swipeable from 'react-native-swipeable';\n\nconst leftContent = \u003cText\u003ePull to activate\u003c/Text\u003e;\n\nconst rightButtons = [\n  \u003cTouchableHighlight\u003e\u003cText\u003eButton 1\u003c/Text\u003e\u003c/TouchableHighlight\u003e,\n  \u003cTouchableHighlight\u003e\u003cText\u003eButton 2\u003c/Text\u003e\u003c/TouchableHighlight\u003e\n];\n\nfunction MyListItem() {\n  return (\n    \u003cSwipeable leftContent={leftContent} rightButtons={rightButtons}\u003e\n      \u003cText\u003eMy swipeable content\u003c/Text\u003e\n    \u003c/Swipeable\u003e\n  );\n}\n```\n\n### Props\n\n| prop                            | type         | default | description                                                                               |\n|---------------------------------|--------------|---------|-------------------------------------------------------------------------------------------|\n| `children`                      | renderable   | `null`  | swipeable content                                                                         |\n| `leftContent`                   | renderable   | `null`  | (optional) left content visible during pull action                                        |\n| `rightContent`                  | renderable   | `null`  | (optional) right content visible during pull action                                       |\n| `leftButtons`                   | renderable[] | `null`  | (optional) array of buttons, first being the innermost; ignored if `leftContent` present  |\n| `rightButtons`                  | renderable[] | `null`  | (optional) array of buttons, first being the innermost; ignored if `rightContent` present |\n| `leftActionActivationDistance`  | integer      | 125     | (optional) minimum swipe distance to activate left action                                 |\n| `onLeftActionRelease`           | function     | `null`  | (optional) user has swiped beyond `leftActionActivationDistance` and released             |\n| `rightActionActivationDistance` | integer      | 125     | (optional) minimum swipe distance to activate right action                                |\n| `onRightActionRelease`          | function     | `null`  | (optional) user has swiped beyond `rightActionActivationDistance` and released            |\n| `leftButtonWidth`               | integer      | 75      | (optional) resting visible peek of each left button after buttons are swiped open         |\n| `rightButtonWidth`              | integer      | 75      | (optional) resting visible peek of each right button after buttons are swiped open        |\n| `onRef`                         | function     | `null`  | (optional) receive swipeable component instance reference                                 |\n| `onPanAnimatedValueRef`         | function     | `null`  | (optional) receive swipeable pan `Animated.ValueXY` reference for upstream animations     |\n\n### Advanced Props\n\n[Check out the `Swipeable` component's `propTypes`](https://github.com/jshanson7/react-native-swipeable/blob/master/src/index.js#L14) for a huge list of options including animation lifecycle hooks and low-level overrides.\n\n### Instance Methods\n\n#### recenter()\n\nImperatively reset swipeable component back to initial position.  This is useful if buttons are exposed and the user has begun scrolling the parent view.\n\n```javascript\nclass MyListItem extends Component {\n\n  swipeable = null;\n\n  handleUserBeganScrollingParentView() {\n    this.swipeable.recenter();\n  }\n\n  render() {\n    return (\n      \u003cSwipeable onRef={ref =\u003e this.swipeable = ref} rightButtons={rightButtons}\u003e\n        \u003cText\u003eMy swipeable content\u003c/Text\u003e\n      \u003c/Swipeable\u003e\n    );\n  }\n}\n```\n\n## Example\n\nTo run [the example](https://github.com/jshanson7/react-native-swipeable/blob/master/example/swipeable-example.js):\n\n```sh\nnpm run build\ncd example\nnpm install\nreact-native run-ios # or run-android\n```\n\n\u003cimg src=\"https://raw.githubusercontent.com/jshanson7/react-native-swipeable/master/example/example.ios.gif\" width=\"275\"\u003e \u003cimg src=\"https://raw.githubusercontent.com/jshanson7/react-native-swipeable/master/example/example.android.gif\" width=\"275\"\u003e\n\n## Common Issues\n\n\u003e Action being triggered more than once ([#3](https://github.com/jshanson7/react-native-swipeable/issues/3))\n\nThis seems to occur occasionally (but not always) with certain `ScrollView` and `ListView` configurations.  The fix is simple though, just ensure that `scrollEnabled` is set to `false` while the user is swiping a row.\n\n```js\n\u003cScrollView scrollEnabled={!this.state.isSwiping}\u003e\n  \u003cSwipeable\n    onSwipeStart={() =\u003e this.setState({isSwiping: true})}\n    onSwipeRelease={() =\u003e this.setState({isSwiping: false})}\n  \u003c/Swipeable\u003e\n\u003c/ScrollView\u003e\n```\nor:\n```js\n\u003cListView\n  scrollEnabled={!this.state.isSwiping}\n  renderRow={() =\u003e (\n    \u003cSwipeable\n      onSwipeStart={() =\u003e this.setState({isSwiping: true})}\n      onSwipeRelease={() =\u003e this.setState({isSwiping: false})}\n    \u003c/Swipeable\u003e\n  )}\n/\u003e\n```\n\n## License\n\nMIT\n\n[npm-image]: https://badge.fury.io/js/react-native-swipeable.svg\n[npm-url]: https://npmjs.org/package/react-native-swipeable\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjshanson7%2Freact-native-swipeable","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjshanson7%2Freact-native-swipeable","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjshanson7%2Freact-native-swipeable/lists"}