{"id":22434505,"url":"https://github.com/sieuhuflit/react-native-swipe-close-image","last_synced_at":"2025-08-01T14:30:58.469Z","repository":{"id":57340588,"uuid":"147211802","full_name":"sieuhuflit/react-native-swipe-close-image","owner":"sieuhuflit","description":"A React native swipe to close image","archived":false,"fork":false,"pushed_at":"2018-09-04T01:52:42.000Z","size":12508,"stargazers_count":18,"open_issues_count":2,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-19T22:44:01.206Z","etag":null,"topics":["close","react-native","swipe","swipe-to-close"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sieuhuflit.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-09-03T13:53:01.000Z","updated_at":"2023-06-19T02:17:54.000Z","dependencies_parsed_at":"2022-09-11T13:32:05.068Z","dependency_job_id":null,"html_url":"https://github.com/sieuhuflit/react-native-swipe-close-image","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sieuhuflit/react-native-swipe-close-image","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sieuhuflit%2Freact-native-swipe-close-image","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sieuhuflit%2Freact-native-swipe-close-image/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sieuhuflit%2Freact-native-swipe-close-image/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sieuhuflit%2Freact-native-swipe-close-image/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sieuhuflit","download_url":"https://codeload.github.com/sieuhuflit/react-native-swipe-close-image/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sieuhuflit%2Freact-native-swipe-close-image/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268241967,"owners_count":24218382,"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","status":"online","status_checked_at":"2025-08-01T02:00:08.611Z","response_time":67,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["close","react-native","swipe","swipe-to-close"],"created_at":"2024-12-05T23:08:36.667Z","updated_at":"2025-08-01T14:30:57.978Z","avatar_url":"https://github.com/sieuhuflit.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# React native swipe close image\n\n\u003e A swipe close full screen image for Android and iOS\n\n![](https://github.com/sieuhuflit/react-native-swipe-close-image/blob/master/demo.gif)\n\n## Installation\n\n```\nnpm install react-native-swipe-close-image --save\n```\n\n## Using\n\n- Create SwipeCloseImage in render() with imageSource is the source of image (Can be local or remote url link)\n\n```js\nimport SwipeCloseImage from 'react-native-swipe-close-image';\n...\nrender() {\n...\n\u003cSwipeCloseImage\n  ref={c =\u003e (this.swipeToCloseRef = c)}\n  imageSource={this.state.imageSource}\n/\u003e\n...\n}\n```\n\n- Then when want to open the image\n\n```js\n...\nthis.swipeToCloseRef.onOpen(this.imageRef);\n...\n```\n\n### Code\n\n```js\nimport SwipeCloseImage from 'react-native-swipe-close-image';\n\nexport default class App extends Component {\n  onPressImage = () =\u003e {\n    this.swipeToCloseRef.onOpen(this.imageRef);\n    this.setState({\n      imageSource:\n        'https://facebook.github.io/react-native/docs/assets/favicon.png'\n    });\n  };\n\n  render() {\n    return (\n      \u003cView style={styles.container}\u003e\n        \u003cTouchableWithoutFeedback onPress={this.onPressImage}\u003e\n          \u003cImage\n            ref={c =\u003e {\n              this.imageRef = c;\n            }}\n            source={{\n              uri:\n                'https://facebook.github.io/react-native/docs/assets/favicon.png'\n            }}\n            resizeMode=\"contain\"\n            style={styles.imageStyle}\n          /\u003e\n        \u003c/TouchableWithoutFeedback\u003e\n        \u003cSwipeCloseImage\n          ref={c =\u003e (this.swipeToCloseRef = c)}\n          imageSource={this.state.imageSource}\n        /\u003e\n      \u003c/View\u003e\n    );\n  }\n}\n\nconst styles = StyleSheet.create({\n  container: {\n    flex: 1,\n    justifyContent: 'center',\n    alignItems: 'center'\n  },\n  imageStyle: {\n    width: 250,\n    height: 200\n  }\n});\n```\n\n[Example](./example/index.js)\n\n## Props\n\n| Prop            |      Default      |      Type       | Description                                          |\n| :-------------- | :---------------: | :-------------: | :--------------------------------------------------- |\n| imageSource     |     required      | `string,number` | Link of the source url (Can be local or remote link) |\n| onOpen          |     required      |   `function`    | Function to open the image                           |\n| resizeMode      |      Contain      |    `string`     | Resize mode for the image                            |\n| backdropColor   | rgba(0,0,0,0.75)  |    `string`     | Backdrop color                                       |\n| durationAnim    |        250        |    `number`     | Milisecond animation                                 |\n| distanceDismiss | SCREEN_HEIGHT / 5 |    `number`     | Distance to auto dismiss close image                 |\n\n## Author\n\nSieu Thai – sieuhuflit@example.com\n\n[https://github.com/sieuhuflit](https://github.com/sieuhuflit/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsieuhuflit%2Freact-native-swipe-close-image","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsieuhuflit%2Freact-native-swipe-close-image","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsieuhuflit%2Freact-native-swipe-close-image/lists"}