{"id":16750044,"url":"https://github.com/n4kz/react-native-pages","last_synced_at":"2025-04-12T22:34:37.768Z","repository":{"id":41519348,"uuid":"86553357","full_name":"n4kz/react-native-pages","owner":"n4kz","description":"Easy to use page view component","archived":false,"fork":false,"pushed_at":"2022-09-26T15:44:33.000Z","size":929,"stargazers_count":376,"open_issues_count":20,"forks_count":83,"subscribers_count":11,"default_branch":"master","last_synced_at":"2024-10-14T02:26:50.986Z","etag":null,"topics":["android","ios","react","react-native"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/n4kz.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"license.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-03-29T07:48:32.000Z","updated_at":"2024-06-19T13:57:09.000Z","dependencies_parsed_at":"2022-09-26T16:21:24.745Z","dependency_job_id":null,"html_url":"https://github.com/n4kz/react-native-pages","commit_stats":null,"previous_names":[],"tags_count":22,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/n4kz%2Freact-native-pages","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/n4kz%2Freact-native-pages/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/n4kz%2Freact-native-pages/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/n4kz%2Freact-native-pages/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/n4kz","download_url":"https://codeload.github.com/n4kz/react-native-pages/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248642308,"owners_count":21138350,"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":["android","ios","react","react-native"],"created_at":"2024-10-13T02:26:53.226Z","updated_at":"2025-04-12T22:34:37.750Z","avatar_url":"https://github.com/n4kz.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[npm-badge]: https://img.shields.io/npm/v/react-native-pages.svg?colorB=ff6d00\n[npm-url]: https://npmjs.com/package/react-native-pages\n[license-badge]: https://img.shields.io/npm/l/react-native-pages.svg?colorB=448aff\n[license-url]: https://raw.githubusercontent.com/n4kz/react-native-pages/master/license.txt\n[travis-badge]: https://api.travis-ci.org/n4kz/react-native-pages.svg?branch=master\n[travis-url]: https://travis-ci.org/n4kz/react-native-pages?branch=master\n[codeclimate-badge]: https://img.shields.io/codeclimate/maintainability/n4kz/react-native-pages.svg\n[codeclimate-url]: https://codeclimate.com/github/n4kz/react-native-pages\n[example-source]: https://github.com/n4kz/react-native-pages/blob/master/example/app.js\n[example-url]: https://cloud.githubusercontent.com/assets/2055622/25063699/68d6914e-21f4-11e7-81fe-b72d8e003530.gif\n[indicator-source]: https://github.com/n4kz/react-native-pages/blob/master/src/components/indicator/index.js\n\n# react-native-pages\n\n[![npm][npm-badge]][npm-url]\n[![license][license-badge]][license-url]\n[![travis][travis-badge]][travis-url]\n[![codeclimate][codeclimate-badge]][codeclimate-url]\n\nEasy to use page view component for React Native\n\n![example][example-url]\n\n## Features\n\n* Easy to use\n* Consistent look and feel on iOS and Android\n* Landscape and portrait orientation support\n* Parallax and complex animation support\n* Animated page indicator\n* Configurable scroll direction\n* Configurable page indicator position, color and opacity\n* RTL support\n* Pure javascript implementation\n\n## Installation\n\n```bash\nnpm install --save react-native-pages\n```\n\n## Usage\n\n```javascript\nimport React, { Component } from 'react';\nimport { Pages } from 'react-native-pages';\n\nclass Example extends Component {\n  render() {\n    return (\n      \u003cPages\u003e\n        \u003cView style={{ flex: 1, backgroundColor: 'red' }} /\u003e\n        \u003cView style={{ flex: 1, backgroundColor: 'green' }} /\u003e\n        \u003cView style={{ flex: 1, backgroundColor: 'blue' }} /\u003e\n      \u003c/Pages\u003e\n    );\n  }\n}\n```\n\n## Properties\n\n name              | description                            | type     | default\n:----------------- |:-------------------------------------- | --------:|:------------------\n horizontal        | Scroll direction                       |  Boolean | true\n rtl               | RTL mode for horizontal scroll         |  Boolean | false\n startPage         | Start page                             |   Number | 0\n indicatorColor    | Page indicator color                   |   String | rgb(255, 255, 255)\n indicatorOpacity  | Page indicator opacity (inactive dots) |   Number | 0.30\n indicatorPosition | Page indicator position                |   String | bottom\n containerStyle    | Style for container view               |   Object | -\n progress          | Animated.Value updated with progress   |   Object | -\n onScrollStart     | Scroll start callback                  | Function | -\n onScrollEnd       | Scroll end callback                    | Function | -\n onHalfway         | Dominant page change callback          | Function | -\n renderPager       | Render pager callback                  | Function | -\n\nPossible values for `indicatorPosition` are `none`, `top`, `right`, `bottom` and `left`\n\n## Methods\n\n name           | description                                       | returns\n:-------------- |:------------------------------------------------- | -------:\n scrollToPage   | Scroll to page with optional animation            | -\n isDragging     | Returns whether the user has begun scrolling      | Boolean\n isDecelerating | Returns whether content is moving after scrolling | Boolean\n\n## Replacing page indicator\n\n```javascript\nimport { Indicator, Pages } from 'react-native-pages';\n\nclass Example extends Component {\n  _renderPager = (options) =\u003e {\n    let {\n      rtl,\n      pages,\n      progress,\n      horizontal,\n      indicatorColor,\n      indicatorOpacity,\n      indicatorPosition,\n    } = options;\n\n    if ('none' === indicatorPosition) {\n      return null;\n    }\n\n    return (\n      \u003cIndicator {...options} /\u003e\n    );\n  };\n\n  render() {\n    let { children, ...props } = this.props;\n\n    return (\n      \u003cPages {...props} renderPager={this._renderPager}\u003e\n        {children}\n      \u003c/Pages\u003e\n    );\n  }\n}\n```\n\nFor implementation details take look at [Indicator][indicator-source] component\n\n## Parallax and other animations\n\nAll child components receive the following props\n\n name     | description                          | type\n:-------- |:------------------------------------ | ------:\n index    | Page index                           | Number\n pages    | Page count                           | Number\n progress | Animated.Value with current progress | Object\n\nFor usage example take look at example app [source code][example-source]\n\n## Example\n\n```bash\ngit clone https://github.com/n4kz/react-native-pages\ncd react-native-pages/example\nnpm install\nnpm run ios # or npm run android\n```\n\n## Copyright and License\n\nBSD License\n\nCopyright 2017-2019 Alexander Nazarov. All rights reserved.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fn4kz%2Freact-native-pages","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fn4kz%2Freact-native-pages","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fn4kz%2Freact-native-pages/lists"}