{"id":18782865,"url":"https://github.com/rescript-react-native/viewpager","last_synced_at":"2025-04-13T12:08:47.816Z","repository":{"id":40724545,"uuid":"235044612","full_name":"rescript-react-native/viewpager","owner":"rescript-react-native","description":"ReScript bindings for @react-native-community/viewpager","archived":false,"fork":false,"pushed_at":"2023-05-07T19:28:57.000Z","size":255,"stargazers_count":5,"open_issues_count":3,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-13T12:08:42.011Z","etag":null,"topics":["react","react-native","rescript","rescript-react","rescript-react-native","viewpager"],"latest_commit_sha":null,"homepage":"","language":"ReScript","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/rescript-react-native.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}},"created_at":"2020-01-20T07:39:17.000Z","updated_at":"2024-11-05T00:20:28.000Z","dependencies_parsed_at":"2023-07-18T16:01:53.682Z","dependency_job_id":null,"html_url":"https://github.com/rescript-react-native/viewpager","commit_stats":{"total_commits":20,"total_committers":5,"mean_commits":4.0,"dds":"0.30000000000000004","last_synced_commit":"010400530c7de0823626e8088f1a56fddbdac0ef"},"previous_names":["reason-react-native/viewpager"],"tags_count":3,"template":false,"template_full_name":"rescript-react-native/__template__","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rescript-react-native%2Fviewpager","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rescript-react-native%2Fviewpager/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rescript-react-native%2Fviewpager/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rescript-react-native%2Fviewpager/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rescript-react-native","download_url":"https://codeload.github.com/rescript-react-native/viewpager/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248710430,"owners_count":21149190,"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":["react","react-native","rescript","rescript-react","rescript-react-native","viewpager"],"created_at":"2024-11-07T20:37:17.192Z","updated_at":"2025-04-13T12:08:47.795Z","avatar_url":"https://github.com/rescript-react-native.png","language":"ReScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# `@rescript-react-native/viewpager`\n\n[![Build Status](https://github.com/rescript-react-native/viewpager/workflows/Build/badge.svg)](https://github.com/rescript-react-native/viewpager/actions)\n[![Version](https://img.shields.io/npm/v/@rescript-react-native/viewpager.svg)](https://www.npmjs.com/@rescript-react-native/viewpager)\n[![ReScript Forum](https://img.shields.io/discourse/posts?color=e6484f\u0026label=ReScript%20Forum\u0026server=https%3A%2F%2Fforum.rescript-lang.org)](https://forum.rescript-lang.org/)\n\n[ReScript](https://rescript-lang.org) bindings for\n[`@react-native-community/viewpager`](https://github.com/callstack/react-native-viewpager).\n\nExposed as `ReactNativeViewPager` module.\n\n`@rescript-react-native/viewpager` X.y.\\* means it's compatible with\n`@react-native-community/viewpager` X.y.\\*\n\n## Installation\n\nWhen\n[`@react-native-community/viewpager`](https://github.com/callstack/react-native-viewpager)\nis properly installed \u0026 configured by following their installation instructions,\nyou can install the bindings:\n\n```console\nnpm install @rescript-react-native/viewpager\n# or\nyarn add @rescript-react-native/viewpager\n```\n\n`@rescript-react-native/viewpager` should be added to `bs-dependencies` in your\n`bsconfig.json`:\n\n```diff\n{\n  //...\n  \"bs-dependencies\": [\n    \"@rescript/react\",\n    \"rescript-react-native\",\n    // ...\n+    \"@rescript-react-native/viewpager\"\n  ],\n  //...\n}\n```\n\n## Usage\n\n```rescript\n[@react.component]\nlet app = () =\u003e\n    \u003cSafeAreaView style={styles##body}\u003e\n      \u003cReactNativeViewPager style={styles##body}\n        initialPage=1\n        pageMargin=13\n        transitionStyle={`curl}\n        showPageIndicator=true\n        \u003e\n        \u003cView style={styles##red}/\u003e\n        \u003cView style={styles##blue}/\u003e\n        \u003cView style={styles##green}/\u003e\n      \u003c/ReactNativeViewPager\u003e\n    \u003c/SafeAreaView\u003e;\n```\n\n#### `ReactNativeViewPager` props\n\n```rescript\n~ref: ref=?,\n~initialPage: int=?,\n~scrollEnabled: bool=?,\n~onPageScroll: PageScrollEvent.t =\u003e unit=?,\n~onPageSelected: PageSelectedEvent.t =\u003e unit=?,\n~onPageScrollStateChanged: PageScrollStateChangedEvent.t =\u003e unit=?,\n~keyboardDismissMode: [@bs.string] [ | `none | [@bs.as \"on-drag\"] `onDrag]=?,\n~pageMargin: int=?,\n~onMoveShouldSetResponderCapture: ReactNative.Event.pressEvent =\u003e bool=?,\n~style: ReactNative.Style.t=?,\n~children: React.element=?,\n~orientation: [@bs.string] [ | `horizontal | `vertical]=?,\n~transitionStyle: [@bs.string] [ | `scroll | `curl]=?,\n~showPageIndicator: bool=?\n```\n\n### Methods\n\n#### `ReactNativeViewPager.setPage`\n\n```rescript\nsetPage: (T.t, int) =\u003e unit = \"setPage\";\n```\n\n#### `ReactNativeViewPager.setPage`\n\n```rescript\nsetPageWithoutAnimation: (T.t, int) =\u003e unit =\n    \"setPageWithoutAnimation\";\n```\n\n---\n\n## Changelog\n\nCheck the [changelog](./CHANGELOG.md) for more informations about recent\nreleases.\n\n---\n\n## Contribute\n\nRead the\n[contribution guidelines](https://github.com/rescript-react-native/.github/blob/master/CONTRIBUTING.md)\nbefore contributing.\n\n## Code of Conduct\n\nWe want this community to be friendly and respectful to each other. Please read\n[our full code of conduct](https://github.com/rescript-react-native/.github/blob/master/CODE_OF_CONDUCT.md)\nso that you can understand what actions will and will not be tolerated.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frescript-react-native%2Fviewpager","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frescript-react-native%2Fviewpager","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frescript-react-native%2Fviewpager/lists"}