{"id":3967,"url":"https://github.com/phil-r/react-native-looped-carousel","last_synced_at":"2025-04-13T11:46:37.787Z","repository":{"id":29784792,"uuid":"33328911","full_name":"phil-r/react-native-looped-carousel","owner":"phil-r","description":":carousel_horse: Looped carousel for React Native","archived":false,"fork":false,"pushed_at":"2023-09-29T16:35:16.000Z","size":1372,"stargazers_count":1487,"open_issues_count":89,"forks_count":306,"subscribers_count":29,"default_branch":"master","last_synced_at":"2025-04-10T20:21:39.403Z","etag":null,"topics":["carousel","react","react-native"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"romabelka/basic-react-1902","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/phil-r.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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}},"created_at":"2015-04-02T19:56:05.000Z","updated_at":"2025-04-02T08:01:44.000Z","dependencies_parsed_at":"2024-01-28T10:03:29.870Z","dependency_job_id":"6465dbe5-0b6d-4f95-a881-3c6f6700ff93","html_url":"https://github.com/phil-r/react-native-looped-carousel","commit_stats":{"total_commits":180,"total_committers":39,"mean_commits":4.615384615384615,"dds":0.7888888888888889,"last_synced_commit":"d6df19a76e2a2cf3318738d805ec85d8a59473a0"},"previous_names":["appintheair/react-native-looped-carousel"],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phil-r%2Freact-native-looped-carousel","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phil-r%2Freact-native-looped-carousel/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phil-r%2Freact-native-looped-carousel/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phil-r%2Freact-native-looped-carousel/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/phil-r","download_url":"https://codeload.github.com/phil-r/react-native-looped-carousel/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248710408,"owners_count":21149185,"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":["carousel","react","react-native"],"created_at":"2024-01-05T20:16:56.819Z","updated_at":"2025-04-13T11:46:37.767Z","avatar_url":"https://github.com/phil-r.png","language":"JavaScript","funding_links":[],"categories":["Components","JavaScript"],"sub_categories":["UI"],"readme":"# Looped carousel for React Native\n[![NPM version](https://img.shields.io/npm/v/react-native-looped-carousel.svg)](https://www.npmjs.com/package/react-native-looped-carousel)\n[![Build Status](https://travis-ci.org/phil-r/react-native-looped-carousel.svg?branch=master)](https://travis-ci.org/phil-r/react-native-looped-carousel)\n[![Dependency Status](https://david-dm.org/phil-r/react-native-looped-carousel.svg)](https://david-dm.org/phil-r/react-native-looped-carousel)\n[![devDependency Status](https://david-dm.org/phil-r/react-native-looped-carousel/dev-status.svg)](https://david-dm.org/phil-r/react-native-looped-carousel?type=dev)\n\nFull-fledged \"infinite\" carousel for your next [react-native](https://github.com/facebook/react-native/) project. Supports iOS and Android.\n\nBased on [react-native framework](https://github.com/facebook/react-native/) by Facebook.\n\n## Demo\n![demo gif](https://user-images.githubusercontent.com/577316/37863420-40c62c8c-2f5e-11e8-8eb4-23b8e7ea499e.gif)\n\n## Install\n\n```sh\nnpm install react-native-looped-carousel --save\n```\n\n## Examples\n\n - [Simple](https://snack.expo.io/@phil/carousel-simple-example)\n - [Modal](https://snack.expo.io/@phil/carousel-modal-example)\n - [Arrows](https://snack.expo.io/@phil/carousel-arrow-example)\n - [Dynamic content](https://snack.expo.io/@phil/carousel-dynamic-content-example)\n - [Animate to page](https://snack.expo.io/@phil/carousel-animate-to-page-example)\n\n## Props\n\nName | propType | default value | description\n--- | --- | --- | ---\nautoplay | boolean | true | enables auto animations\ndelay | number | 4000 | number in milliseconds between auto animations\ncurrentPage | number | 0 | allows you to set initial page\npageStyle | style | null | style for pages\ncontentContainerStyle | style | null | `contentContainerStyle` for the scrollView\nonAnimateNextPage | func | null | callback that is called with 0-based Id of the current page\nonPageBeingChanged | func | null | callback that is called when scroll start with 0-based Id of the next page\nswipe | bool | true | motion control for Swipe\nisLooped | bool | true | if it's possible to scroll infinitely\n**Pagination** | --- | --- | ---\npageInfo | boolean | false | shows `{currentPage} / {totalNumberOfPages}` pill at the bottom\npageInfoBackgroundColor | string | 'rgba(0, 0, 0, 0.25)' | background color for pageInfo\npageInfoBottomContainerStyle | style | null | style for the pageInfo container\npageInfoTextStyle | style | null | style for text in pageInfo\npageInfoTextSeparator | string | ' / ' | separator for `{currentPage}` and `{totalNumberOfPages}`\n**Bullets** | --- | --- | ---\nbullets | bool | false | wether to show \"bullets\" at the bottom of the carousel\nbulletStyle | style | null | style for each bullet\nbulletsContainerStyle | style | null | style for the bullets container\nchosenBulletStyle | style | null | style for the selected bullet\n**Arrows** | --- | --- | ---\narrows | bool | false | wether to show navigation arrows for the carousel\narrowStyle | style | null | style for navigation arrows\nleftArrowStyle | style | null | style for left navigation arrow\nrightArrowStyle | style | null | style for right navigation arrow\narrowsContainerStyle | style | null | style for the navigation arrows container\nleftArrowText | string | 'Left' | label for left navigation arrow\nrightArrowText | string | 'Right' | label for right navigation arrow\n\n## Change the page\n\nThree options :\n- Go to a specific page\n- Go to the next page\n- Go to the previous page\n\n```js\n// assuming ref is set up on the carousel as (ref) =\u003e this._carousel = ref\nonPress={() =\u003e {this._carousel.animateToPage(page)}}\nonPress={() =\u003e {this._carousel._animateNextPage()}}\nonPress={() =\u003e {this._carousel._animatePreviousPage()}}\n```\n\n\n## Usage\n\n```js\nimport React, { Component } from 'react';\nimport {\n  Text,\n  View,\n  Dimensions,\n} from 'react-native';\nimport Carousel from 'react-native-looped-carousel';\n\nconst { width, height } = Dimensions.get('window');\n\nexport default class CarouselExample extends Component {\n\n  constructor(props) {\n    super(props);\n\n    this.state = {\n      size: { width, height },\n    };\n  }\n\n  _onLayoutDidChange = (e) =\u003e {\n    const layout = e.nativeEvent.layout;\n    this.setState({ size: { width: layout.width, height: layout.height } });\n  }\n\n  render() {\n    return (\n      \u003cView style={{ flex: 1 }} onLayout={this._onLayoutDidChange}\u003e\n        \u003cCarousel\n          delay={2000}\n          style={this.state.size}\n          autoplay\n          pageInfo\n          onAnimateNextPage={(p) =\u003e console.log(p)}\n        \u003e\n          \u003cView style={[{ backgroundColor: '#BADA55' }, this.state.size]}\u003e\u003cText\u003e1\u003c/Text\u003e\u003c/View\u003e\n          \u003cView style={[{ backgroundColor: 'red' }, this.state.size]}\u003e\u003cText\u003e2\u003c/Text\u003e\u003c/View\u003e\n          \u003cView style={[{ backgroundColor: 'blue' }, this.state.size]}\u003e\u003cText\u003e3\u003c/Text\u003e\u003c/View\u003e\n        \u003c/Carousel\u003e\n      \u003c/View\u003e\n    );\n  }\n}\n```\n\n## Used in\n - [React Native Buyscreen](https://github.com/appintheair/react-native-buyscreen)\n\n## See also\n - [React Native Grid Component](https://github.com/phil-r/react-native-grid-component)\n\n----\n\nMore on react-native here: https://facebook.github.io/react-native/docs/getting-started.html\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphil-r%2Freact-native-looped-carousel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphil-r%2Freact-native-looped-carousel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphil-r%2Freact-native-looped-carousel/lists"}