{"id":24063997,"url":"https://github.com/qeepsake/react-native-subset-navigator","last_synced_at":"2026-05-15T09:33:42.617Z","repository":{"id":52505478,"uuid":"339188049","full_name":"Qeepsake/react-native-subset-navigator","owner":"Qeepsake","description":"An in-built navigator to simplify embedded navigation flows.","archived":false,"fork":false,"pushed_at":"2021-06-03T20:24:17.000Z","size":2390,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-31T06:48:52.527Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Qeepsake.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-02-15T19:43:35.000Z","updated_at":"2021-10-13T15:51:06.000Z","dependencies_parsed_at":"2022-09-17T16:20:40.665Z","dependency_job_id":null,"html_url":"https://github.com/Qeepsake/react-native-subset-navigator","commit_stats":null,"previous_names":["aspect-apps/react-native-subset-navigator"],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Qeepsake%2Freact-native-subset-navigator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Qeepsake%2Freact-native-subset-navigator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Qeepsake%2Freact-native-subset-navigator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Qeepsake%2Freact-native-subset-navigator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Qeepsake","download_url":"https://codeload.github.com/Qeepsake/react-native-subset-navigator/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240898659,"owners_count":19875225,"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":"2025-01-09T10:06:05.442Z","updated_at":"2026-05-15T09:33:42.588Z","avatar_url":"https://github.com/Qeepsake.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# react-native-subset-navigator\nAn in-built navigator to simplify embedded navigation flows.\n\n\n## Install\n\n```sh\n npm install react-native-subset-navigator --save\n```\n\nor\n\n```sh\n yarn add react-native-subset-navigator\n```\n\n## Usage\n\n1. Create the Subset Navigator\n`createSubsetNavigator(nameOfFirstOverlay, Overlays, props)`\n\n````js\nimport { createSubsetNavigator } from \"react-native-subset-navigator\";\n\n // props are optional \nconst OnboardingOverlay = (props) =\u003e {\n        const OverlaySubset = createSubsetNavigator(\"OnboardingOne\", {\n          \"OnboardingOne\": OnboardingOne,\n          \"OnboardingTwo\": OnboardingTwo,\n          \"OnboardingThree\": OnboardingThree,\n        }, props)\n\n    return (\n        \u003cView style={styles.containerStyle}\u003e // \u003c-- modal common container\n            {OverlaySubset}\n        \u003c/View\u003e \n    );\n}\n.....\n````\n\n2. Render the subset navigator\n- The `passProps` props passes props to the first screen of the subset navigator \n\n````js\nimport {OnboardingOverlay} from '../components/on-boarding-overlay';\n\nexport const OnBoardingPage = () =\u003e {\n    const [pageNumber, setPageNumber] = useState(1);\n\n    return(\n      ...\n      // These props will only be passed to the first screen/component\n      \u003cOnboardingOverlay passProps={{setPageNumber}} /\u003e\n      ...\n    )\n}\n````\n\n3. Create the components/ screens to take in a 'navigator' prop and use the `push` and `pop` methods to navigate.\n- Pass props to subsequent screens/ components with the second parameter of the `push` method. These props can also be accessed by the `passProps` prop\n\n````js\nconst OnboardingOne = ({ navigator, passProps }) =\u003e {\n    return (\n        \u003c\u003e\n            \u003cTouchableOpacity onPress={() =\u003e {\n                navigator.push(\"OnboardingTwo\", {\n                setPageNumber: passProps.setPageNumber,\n                })}\n            }\u003e\n                \u003cView /\u003e\n            \u003c/TouchableOpacity\u003e\n            \u003cTouchableOpacity onPress={() =\u003e navigator.pop()}\u003e\n                \u003cView /\u003e\n            \u003c/TouchableOpacity\u003e\n            \u003cTouchableOpacity onPress={() =\u003e passProps.setPageNumber(2)}\u003e\n                \u003cView /\u003e\n            \u003c/TouchableOpacity\u003e\n        \u003c/\u003e\n    );\n}\n````\n\n### Animations\nWe can now add animations when switching between screens in the subset navigator.\n\nExample\n````js\nimport { Animated, ... } from 'react-native' //\u003c-- import Animated from react-native\nimport {\n  useFadeInAnimation,\n  useSlideRightAnimation,\n} from 'react-native-subset-navigator' //\u003c-- import the animations you want\n\n\nconst OnboardingOne = ({ navigator, passProps }) =\u003e {\n    // Use animations like so\n    const animatedOpacity = useFadeInAnimation()\n    const slideRightAnimation = useSlideRightAnimation()\n\n    return (\n    // Use Animated\n    \u003cAnimated.View style={[animatedOpacity, slideRightAnimation]}\u003e\n        \u003cTouchableOpacity onPress={() =\u003e navigator.push(\"OnboardingTwo\")}\u003e\n            \u003cView /\u003e\n        \u003c/TouchableOpacity\u003e\n        \u003cTouchableOpacity onPress={() =\u003e navigator.pop()}\u003e\n            \u003cView /\u003e\n        \u003c/TouchableOpacity\u003e\n        \u003cTouchableOpacity onPress={() =\u003e passProps.setPageNumber(2)}\u003e\n            \u003cView /\u003e\n        \u003c/TouchableOpacity\u003e\n    \u003c/Animated.View\u003e\n    );\n}\n````\n\n#### Available types \nAvailable animations:\n- `useFadeInAnimation(finalOpacity, duration)`: for fade in animation\n- `useSlideLeftAnimation(duration, easing)`: for slide left animation\n- `useSlideRightAnimation(duration, easing)`: for slide right animation\n- `useSlideUpAnimation(duration, easing)`: for slide up animation\n\nThe params below are used to configure the animations (if applicable).\n\n| Param        | Type          | Optional  | Default | Description                                                                             |\n| ------------ | ------------- | --------- | ------- | --------------------------------------------------------------------------------------- |\n| finalOpacity | number         | Yes      | 1      | Opacity at the end of the animation. 1 is completely opaque.                             |\n| duration     | number         | Yes      | 500    | Time in milliseconds to execute the animation.                                           |\n| easing       | ((value: number) =\u003e number)| Yes | Easing.quad | The easing function for the animation. You can specify your own or use the standard functions from React Native's Easing module.              |\n\n\n## Contributors ✨\n\nThanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --\u003e\n\u003c!-- prettier-ignore-start --\u003e\n\u003c!-- markdownlint-disable --\u003e\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/Denise-Ng\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/50568634?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eDenise-Ng\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/Aspect Apps/react-native-subset-navigator/commits?author=Denise-Ng\" title=\"Code\"\u003e💻\u003c/a\u003e \u003ca href=\"https://github.com/Aspect Apps/react-native-subset-navigator/commits?author=Denise-Ng\" title=\"Documentation\"\u003e📖\u003c/a\u003e \u003ca href=\"#example-Denise-Ng\" title=\"Examples\"\u003e💡\u003c/a\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n\u003c!-- markdownlint-restore --\u003e\n\u003c!-- prettier-ignore-end --\u003e\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:END --\u003e\n\nThis project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqeepsake%2Freact-native-subset-navigator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fqeepsake%2Freact-native-subset-navigator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqeepsake%2Freact-native-subset-navigator/lists"}