{"id":17736791,"url":"https://github.com/paulbgd/react-native-image-slider","last_synced_at":"2025-04-13T05:05:25.508Z","repository":{"id":4270046,"uuid":"52494498","full_name":"PaulBGD/react-native-image-slider","owner":"PaulBGD","description":"A quick and easy image slider for react native. Maintainer wanted!","archived":false,"fork":false,"pushed_at":"2023-09-12T04:54:05.000Z","size":18468,"stargazers_count":237,"open_issues_count":34,"forks_count":103,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-13T05:05:13.597Z","etag":null,"topics":["hacktoberfest"],"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/PaulBGD.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-02-25T03:38:53.000Z","updated_at":"2024-04-25T18:34:01.000Z","dependencies_parsed_at":"2024-06-18T15:24:07.429Z","dependency_job_id":"f83188ea-55dd-4b7c-89d9-3d730b94a669","html_url":"https://github.com/PaulBGD/react-native-image-slider","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PaulBGD%2Freact-native-image-slider","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PaulBGD%2Freact-native-image-slider/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PaulBGD%2Freact-native-image-slider/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PaulBGD%2Freact-native-image-slider/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PaulBGD","download_url":"https://codeload.github.com/PaulBGD/react-native-image-slider/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248665749,"owners_count":21142123,"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":["hacktoberfest"],"created_at":"2024-10-26T00:24:26.935Z","updated_at":"2025-04-13T05:05:25.488Z","avatar_url":"https://github.com/PaulBGD.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# react-native-image-slider\n\nA quick and easy image slider for react native.\n\n![GIF](final.gif)\n\n## Installation\n\n```bash\nnpm install react-native-image-slider --save\n```\nor\n```bash\nyarn add react-native-image-slider\n```\n\n## Usage\n\n```javascript\nimport ImageSlider from 'react-native-image-slider';\n\n// ...\n\nrender() {\n  return (\u003cImageSlider images={[\n    'http://placeimg.com/640/480/any',\n    'http://placeimg.com/640/480/any',\n    'http://placeimg.com/640/480/any'\n  ]}/\u003e)\n}\n```\n\n### Autoplay / Custom buttons / Custom slide / Loop\n\n```javascript\nclass Example extends Component\u003c{}\u003e {\n  render() {\n    const images = [\n      'https://placeimg.com/640/640/nature',\n      'https://placeimg.com/640/640/people',\n      'https://placeimg.com/640/640/animals',\n      'https://placeimg.com/640/640/beer',\n    ];\n\n    return (\n      \u003cSafeAreaView style={styles.container}\u003e\n        \u003cView style={styles.content1}\u003e\n          \u003cText style={styles.contentText}\u003eContent 1\u003c/Text\u003e\n        \u003c/View\u003e\n        \u003cImageSlider\n          loopBothSides\n          autoPlayWithInterval={3000}\n          images={images}\n          customSlide={({ index, item, style, width }) =\u003e (\n            // It's important to put style here because it's got offset inside\n            \u003cView key={index} style={[style, styles.customSlide]}\u003e\n              \u003cImage source={{ uri: item }} style={styles.customImage} /\u003e\n            \u003c/View\u003e\n          )}\n          customButtons={(position, move) =\u003e (\n            \u003cView style={styles.buttons}\u003e\n              {images.map((image, index) =\u003e {\n                return (\n                  \u003cTouchableHighlight\n                    key={index}\n                    underlayColor=\"#ccc\"\n                    onPress={() =\u003e move(index)}\n                    style={styles.button}\n                  \u003e\n                    \u003cText style={position === index \u0026\u0026 styles.buttonSelected}\u003e\n                      {index + 1}\n                    \u003c/Text\u003e\n                  \u003c/TouchableHighlight\u003e\n                );\n              })}\n            \u003c/View\u003e\n          )}\n        /\u003e\n        \u003cView style={styles.content2}\u003e\n          \u003cText style={styles.contentText}\u003eContent 2\u003c/Text\u003e\n        \u003c/View\u003e\n      \u003c/SafeAreaView\u003e\n    );\n  }\n}\n```\n\n## Props\n\n### `images`\n\nrendered images\n\n### `customButtons`\n\nfunction returns custom pagination buttons component, it's got position index and move to position function as arguments\n\n### `customSlide`\n\nfunction returns Node with arguments `index` - images list index, `item` - anything you pass inside images prop, `style` - for top component of your custom slide, `width` - calculated slide width\n\n### `autoPlayWithInterval`\n\nactivates autoplay when passed (it uses milliseconds)\n\n### `loop`\n\n[BUGGY ON ANDROID] loops scroll of images, but in one direction only\n\n### `loopBothSides`\n\n[IOS ONLY] same as loop, but does it in any direction\n\n### `onPositionChanged`\n\ncalled when the current position is changed\n\n### `position`\n\nused for controlled components\n\n### `onPress`\n\nreturns an object with image url and index of image pressed\n\n### `style`\n\nstyles ScrollView inside ImageSlider, you may pass height here (100% by default)\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaulbgd%2Freact-native-image-slider","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpaulbgd%2Freact-native-image-slider","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaulbgd%2Freact-native-image-slider/lists"}