{"id":13527338,"url":"https://github.com/misterfresh/react-easy-transition","last_synced_at":"2025-04-01T09:31:29.812Z","repository":{"id":71820552,"uuid":"53406958","full_name":"misterfresh/react-easy-transition","owner":"misterfresh","description":"Easy transitions with react and react-router","archived":false,"fork":false,"pushed_at":"2018-08-22T11:32:41.000Z","size":3832,"stargazers_count":143,"open_issues_count":5,"forks_count":18,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-21T20:45:40.543Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/misterfresh.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":"2016-03-08T11:28:19.000Z","updated_at":"2023-10-19T09:17:00.000Z","dependencies_parsed_at":"2023-06-11T01:45:26.596Z","dependency_job_id":null,"html_url":"https://github.com/misterfresh/react-easy-transition","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/misterfresh%2Freact-easy-transition","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/misterfresh%2Freact-easy-transition/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/misterfresh%2Freact-easy-transition/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/misterfresh%2Freact-easy-transition/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/misterfresh","download_url":"https://codeload.github.com/misterfresh/react-easy-transition/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246616100,"owners_count":20806057,"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":"2024-08-01T06:01:45.957Z","updated_at":"2025-04-01T09:31:26.412Z","avatar_url":"https://github.com/misterfresh.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# React Easy Transition\n\n```\nnpm install react-easy-transition --save\n```\n\nEasy transitions in react and react-router\n\n## Usage\n\nFor a simple fade-out fade-in effect on route change with react-router :\n\n```jsx\nimport EasyTransition from 'react-easy-transition'\n\n\u003cEasyTransition\n    path={location.pathname}\n    initialStyle={{opacity: 0}}\n    transition=\"opacity 0.3s ease-in\"\n    finalStyle={{opacity: 1}}\n\u003e\n    {this.props.children}\n\u003c/EasyTransition\u003e\n```\n\nMultiple transitions on different properties:\n\n```jsx\n\u003cEasyTransition\n    path={location.pathname}\n    initialStyle={{opacity: 0, color: 'red'}}\n    transition=\"opacity 0.3s ease-in, color 0.5s ease-in\"\n    finalStyle={{opacity: 1, color: 'green'}}\n\u003e\n    {this.props.children}\n\u003c/EasyTransition\u003e\n```\n\nOptionally set a leaveStyle if it is different than the initialStyle:\n\n```jsx\n\u003cEasyTransition\n    path={location.pathname}\n    initialStyle={{opacity: 0, color: 'red'}}\n    transition=\"opacity 0.3s ease-in, color 0.5s ease-in\"\n    finalStyle={{opacity: 1, color: 'green'}}\n    leaveStyle={{opacity: 0, color: 'gray'}}\n\u003e\n    {this.props.children}\n\u003c/EasyTransition\u003e\n```\n\nYou can set a custom component or classname if needed\n\n```jsx\n\u003cEasyTransition\n    path={location.pathname}\n    initialStyle={{opacity: 0, color: 'red'}}\n    transition=\"opacity 0.3s ease-in, color 0.5s ease-in\"\n    finalStyle={{opacity: 1, color: 'green'}}\n    component=\"MyCustomReactComponent\"\n    className=\"myCustomCSSClass\"\n\u003e\n    {this.props.children}\n\u003c/EasyTransition\u003e\n```\n\n**NOTE**: If your `\u003cLink\u003e` component (or any children of this) contains styling/classes that use `transition`, make sure **not** to use `transition: all` as this will prevent react-easy-transition from fading out.\n\n## Live Demo\n\n[Live Demo here](https://react-easy-transition.herokuapp.com/)\n\n## Features\n\n* Small : only 70 lines of code\n* Lightweight : based on ReactTransitionGroup low level API\n* Easy: works out of the box with React Router 2.0, no need to define CSS classes, use Javascript objects to define transition styles.\n* Performance : still using native browser CSS transition under the hood\n* Flexible : support for multiple transitions\n\n## This module solves the following issues:\n\n* The fade-in effect when component mounts is rather straightforward to do with pure CSS transitions. However, the fade-out effect is impossible to do using only CSS because the component disappears immediately when unmounted.\n* The new component appears before the end of the fade-out transition of the previous component, so both are shown at the same time, one on top of the other.\n* Transition on initial render when rendering on the server\n\n## Example\n\n* Integration with react-router, redux, and server-side rendering in ./demo/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmisterfresh%2Freact-easy-transition","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmisterfresh%2Freact-easy-transition","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmisterfresh%2Freact-easy-transition/lists"}