{"id":4108,"url":"https://github.com/anvilabs/react-native-image-carousel","last_synced_at":"2025-08-04T00:31:33.397Z","repository":{"id":57337563,"uuid":"69588800","full_name":"anvilabs/react-native-image-carousel","owner":"anvilabs","description":"Image carousel with support for fullscreen mode with swiping and pinch-to-zoom.","archived":false,"fork":false,"pushed_at":"2018-12-27T04:27:17.000Z","size":144390,"stargazers_count":217,"open_issues_count":8,"forks_count":43,"subscribers_count":10,"default_branch":"master","last_synced_at":"2024-05-29T14:04:51.390Z","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/anvilabs.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":"2016-09-29T17:00:59.000Z","updated_at":"2024-03-12T09:10:16.000Z","dependencies_parsed_at":"2022-09-13T02:42:40.229Z","dependency_job_id":null,"html_url":"https://github.com/anvilabs/react-native-image-carousel","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/anvilabs%2Freact-native-image-carousel","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anvilabs%2Freact-native-image-carousel/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anvilabs%2Freact-native-image-carousel/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anvilabs%2Freact-native-image-carousel/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/anvilabs","download_url":"https://codeload.github.com/anvilabs/react-native-image-carousel/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228576895,"owners_count":17939645,"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-01-05T20:17:01.297Z","updated_at":"2024-12-07T07:31:07.918Z","avatar_url":"https://github.com/anvilabs.png","language":"JavaScript","readme":"# react-native-image-carousel\n\u003e Image carousel with support for heading, captions, fullscreen mode, image swiping and pinch-to-zoom in fullscreen mode.\n\nSupports both Android and iOS. Zoom feature works on iOS only.\n\n## Demo\n\n\u003cimg alt=\"Demo\" src=\".github/demo.gif\" width=\"375\"\u003e\n\n## Installation\n\n`npm install --save react-native-image-carousel`\n\n## Usage\n\n```javascript\nimport ImageCarousel from 'react-native-image-carousel';\n\nexport default class App extends Component\u003cany, any, any\u003e {\n  _imageCarousel: ImageCarousel;\n\n  componentWillMount() {\n    (this: any)._renderHeader = this._renderHeader.bind(this);\n  }\n\n  _renderHeader(): ReactElement\u003cany\u003e {\n    return (\n      \u003cTouchableWithoutFeedback onPress={this._imageCarousel.close}\u003e\n        \u003cView\u003e\n          \u003cText style={styles.closeText}\u003eExit\u003c/Text\u003e\n        \u003c/View\u003e\n      \u003c/TouchableWithoutFeedback\u003e\n    );\n  }\n\n  _renderFooter(): ReactElement\u003cany\u003e {\n    return (\n      \u003cText style={styles.footerText}\u003eFooter!\u003c/Text\u003e\n    );\n  }\n\n  _renderContent(idx: number): ReactElement\u003cany\u003e {\n    return (\n      \u003cImage\n        style={styles.container}\n        source={{ uri: urls[idx] }}\n        resizeMode={'contain'}\n      /\u003e\n    );\n  }\n\n  render(): ReactElement\u003cany\u003e {\n    return (\n      \u003cView style={styles.container}\u003e\n        \u003cImageCarousel\n          ref={(imageCarousel: ImageCarousel) =\u003e {\n            this._imageCarousel = imageCarousel;\n          }}\n          renderContent={this._renderContent}\n          renderHeader={this._renderHeader}\n          renderFooter={this._renderFooter}\n        \u003e\n          {urls.map((url: string): ReactElement\u003cany\u003e =\u003e (\n            \u003cImage\n              key={url}\n              style={styles.image}\n              source={{ uri: url, height: 100 }}\n              resizeMode={'contain'}\n            /\u003e\n          ))}\n        \u003c/ImageCarousel\u003e\n      \u003c/View\u003e\n    );\n  }\n}\n```\n\nCheck full example in _Example_ folder.\n\n### Props and methods\n\n_Every prop is optional._\n\n| Name | Type | Description |\n|---|---|---|\n| `activeProps?` | `Object` | Props of each child when in fullscreen mode. (For a component to fill the screen activeProp's style must be `flex: 1`). This prop is ignored in case `renderContent` prop is provided. |   \n| `activeComponents?` | `[ReactElement\u003cany\u003e]` | Active components' bounds will be used for opening/closing fullscreen mode animations. If not provided, the  immediate children are used. |\n| `zoomEnabled?` | `boolean` | `true` by default, if `false`, children are not zoomable. |\n| `hideStatusBarOnOpen?` | `boolean` | `true` by default, if `false`, status bar does not fade out on open. |\n| `renderContent?` | `(idx: number) =\u003e ReactElement\u003cany\u003e` | Component to render in fullscreen mode for the given index. |\n| `renderHeader?` | `() =\u003e ReactElement\u003cany\u003e` | Component to render at the top when in fullscreen mode. |\n| `renderFooter?` | `() =\u003e ReactElement\u003cany\u003e` | Component to render at the bottom when in fullscreen mode. |\n| `onIdxChange?` | `(idx: number)` | Fired on index change in fullscreen mode. |\n| `onOpen?` | `() =\u003e void` | Fired on fullscreen mode open. |\n| `onClose?` | `() =\u003e void` | Fired on fullscreen mode close. |\n\nreact-native-image-carousel also provides two methods for opening and closing the fullscreen mode respectively:\n\n`open(startIdx: number)`, `close`.\n\n## License\n\n[MIT License](./LICENSE) © Anvilabs LLC \n","funding_links":[],"categories":["Components","Others"],"sub_categories":["UI"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanvilabs%2Freact-native-image-carousel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanvilabs%2Freact-native-image-carousel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanvilabs%2Freact-native-image-carousel/lists"}