{"id":13534146,"url":"https://github.com/Steveeeie/react-page-transition","last_synced_at":"2025-04-01T22:31:20.074Z","repository":{"id":37318642,"uuid":"196460566","full_name":"Steveeeie/react-page-transition","owner":"Steveeeie","description":"A React component that makes it easy to use the page transitions from the Codedrops page transitions demo with React","archived":false,"fork":false,"pushed_at":"2024-07-15T15:02:32.000Z","size":3593,"stargazers_count":444,"open_issues_count":1,"forks_count":25,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-10-16T18:31:22.918Z","etag":null,"topics":["animation","page-transitions","react","react-router","react-transition-group","styled-components","transitions"],"latest_commit_sha":null,"homepage":"https://codesandbox.io/s/advanced-react-page-transition-demo-z8hmd","language":"TypeScript","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/Steveeeie.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-07-11T20:24:50.000Z","updated_at":"2024-10-16T15:33:33.000Z","dependencies_parsed_at":"2024-06-19T00:04:25.796Z","dependency_job_id":"e0914574-03dd-499c-b774-e620a7ffb1a4","html_url":"https://github.com/Steveeeie/react-page-transition","commit_stats":null,"previous_names":["steveeeie/react-page-transitions"],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Steveeeie%2Freact-page-transition","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Steveeeie%2Freact-page-transition/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Steveeeie%2Freact-page-transition/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Steveeeie%2Freact-page-transition/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Steveeeie","download_url":"https://codeload.github.com/Steveeeie/react-page-transition/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":222779859,"owners_count":17036542,"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":["animation","page-transitions","react","react-router","react-transition-group","styled-components","transitions"],"created_at":"2024-08-01T07:01:26.957Z","updated_at":"2024-11-02T21:30:57.402Z","avatar_url":"https://github.com/Steveeeie.png","language":"TypeScript","funding_links":[],"categories":["Uncategorized"],"sub_categories":["Uncategorized"],"readme":"\u003cimg alt=\"Abandoned\" src=\"https://img.shields.io/badge/Abandoned-red\"\u003e \u003cimg alt=\"License\" src=\"https://img.shields.io/npm/l/@steveeeie/react-page-transition\" /\u003e\n\n**IMPORTANT: This project doesn't support newer versions of React or React Router and is for now considered abandoned. Please see: https://github.com/Steveeeie/react-page-transition/issues/33**\n\n# React Page Transition\n\n⚛️💨 A React component that makes it easy to use the page transitions from the Codedrops Page Transitions Demo [See Original](https://tympanus.net/Development/PageTransitions/).\n\n### [View Basic Demo](https://codesandbox.io/s/basic-react-page-transition-demo-rk0uv)\n\n### [View Advanced Demo](https://codesandbox.io/s/advanced-react-page-transition-demo-z8hmd)\n\n### [View TypeScript Demo](https://codesandbox.io/s/advanced-react-page-transition-demo-typescript-nb4lzk)\n\n---\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://github.com/Steveeeie/react-page-transition/blob/master/preview-1.gif?raw=true\" alt=\"preview\" width=\"100%\" /\u003e  \u003cbr/\u003e\n\u003cimg src=\"https://github.com/Steveeeie/react-page-transition/blob/master/preview-2.gif?raw=true\" alt=\"preview\" width=\"100%\" /\u003e\n\u003c/p\u003e\n\n---\n\n## Usage with `react-router`\n\n### 1. Install Package\n\n`npm install @steveeeie/react-page-transition`\n\nor\n\n`yarn add @steveeeie/react-page-transition`\n\n---\n\n### 2. Install Dependencies\n\n`npm install react-router react-router-dom react-transition-group styled-components`\n\nor\n\n`yarn add react-router react-router-dom react-transition-group styled-components`\n\n---\n\n### 3. Code Example\n\n#### App.js\n\n```jsx\nimport React from 'react';\nimport { BrowserRouter, Switch, Route, Link } from 'react-router-dom';\nimport { PageTransition } from '@steveeeie/react-page-transition';\nimport './styles.css';\n\nconst Links = () =\u003e (\n  \u003c\u003e\n    \u003cLink to=\"/\"\u003eHome\u003c/Link\u003e\n    \u003cLink to=\"/about\"\u003eAbout\u003c/Link\u003e\n  \u003c/\u003e\n);\n\nconst Home = props =\u003e \u003ch1\u003eHome\u003c/h1\u003e;\n\nconst About = props =\u003e \u003ch1\u003eAbout\u003c/h1\u003e;\n\nexport default function App() {\n  return (\n    \u003cBrowserRouter\u003e\n      \u003cLinks /\u003e\n      \u003cRoute\n        render={({ location }) =\u003e {\n          return (\n            \u003cPageTransition\n              preset=\"moveToLeftFromRight\"\n              transitionKey={location.pathname}\n            \u003e\n              \u003cSwitch location={location}\u003e\n                \u003cRoute exact path=\"/\" component={Home} /\u003e\n                \u003cRoute exact path=\"/about\" component={About} /\u003e\n              \u003c/Switch\u003e\n            \u003c/PageTransition\u003e\n          );\n        }}\n      /\u003e\n    \u003c/BrowserRouter\u003e\n  );\n}\n```\n\nWrap your routes inside the `PageTransition` component and pass one of the preset names to the `preset` prop. [View the advanced demo](https://codesandbox.io/s/advanced-react-page-transition-demo-z8hmd) for the full list of presets.\n\nYou will also need to pass the current `location.path` to the `transitionKey` prop, this is so that the internal `TransitionGroup` can track which components are entering and exiting.\n\n---\n\n#### styles.css\n\n```css\nhtml,\nbody,\n#root {\n  height: 100%;\n}\n```\n\n`PageTransition` is styled with `height: 100%`. The parent containers need to be given a height for it to render correctly because of this.\n\n---\n\n## Props\n\n| Prop             | Required | Type              | Description                                                         |\n| ---------------- | -------- | ----------------- | ------------------------------------------------------------------- |\n| `preset`         | No       | String            | Sets the enter and exit animations \\*                               |\n| `enterAnimation` | No       | String            | Sets the enter animation \\*                                         |\n| `exitAnimation`  | No       | String            | Sets the exit animation \\*                                          |\n| `transitionKey`  | Yes      | Unique Identifier | Used internally to track which components are entering and exiting. |\n\n##### \\* [View the advanced demo](https://codesandbox.io/s/advanced-react-page-transition-demo-z8hmd) for the full list of presets and animations.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSteveeeie%2Freact-page-transition","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FSteveeeie%2Freact-page-transition","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSteveeeie%2Freact-page-transition/lists"}