{"id":16480630,"url":"https://github.com/fredericheem/react-leanimate","last_synced_at":"2026-06-10T12:31:19.034Z","repository":{"id":57147740,"uuid":"123813648","full_name":"FredericHeem/react-leanimate","owner":"FredericHeem","description":"Animate react components under 600B","archived":false,"fork":false,"pushed_at":"2019-09-01T20:49:36.000Z","size":653,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-11T08:48:43.019Z","etag":null,"topics":["animation","react","react-component"],"latest_commit_sha":null,"homepage":"https://fredericheem.github.io/react-leanimate/","language":"JavaScript","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/FredericHeem.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":"2018-03-04T17:51:50.000Z","updated_at":"2019-02-24T19:06:20.000Z","dependencies_parsed_at":"2022-09-05T16:50:38.663Z","dependency_job_id":null,"html_url":"https://github.com/FredericHeem/react-leanimate","commit_stats":null,"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FredericHeem%2Freact-leanimate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FredericHeem%2Freact-leanimate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FredericHeem%2Freact-leanimate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FredericHeem%2Freact-leanimate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FredericHeem","download_url":"https://codeload.github.com/FredericHeem/react-leanimate/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241181043,"owners_count":19923346,"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","react","react-component"],"created_at":"2024-10-11T13:04:49.263Z","updated_at":"2025-11-24T12:01:27.959Z","avatar_url":"https://github.com/FredericHeem.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# react-leanimate  [![npm version](https://badge.fury.io/js/react-leanimate.svg)](https://badge.fury.io/js/react-leanimate)\nAnimate your react application with lightweight components.  \n\nCheckout the [demo page](https://fredericheem.github.io/react-leanimate/) which is worth more than a thousand words.\n\n## Aminate component ![](http://img.badgesize.io/fredericheem/react-leanimate/master/src/Animate.js.svg?compression=gzip)\nThe problem with animating a react component is simple, you cannot animate a component that has been removed from the DOM. \n\nThe solution is to wrap a component, intercept the unmount lifecycle, clone the underlying DOM node and then apply the desired CSS animation. \n\nHere is a basic example of how to use the *Animate* component:\n\n```jsx\nimport React, { Component } from \"react\";\nimport Animate from \"react-leanimate/Animate\";\n\nclass Toggler extends Component {\n  state = {\n    show: true\n  };\n\n  render() {\n    const { state } = this;\n    return (\n      \u003cdiv\u003e\n        \u003cbutton onClick={() =\u003e this.setState({ show: !state.show })}\u003e\n          Toggle\n        \u003c/button\u003e\n        \u003cdiv\n        \u003e\n          {state.show \u0026\u0026 (\n            \u003cAnimate\n              component={\u003cspan\u003eHello World\u003c/span\u003e}\n              animationHide={\"hide-right 1s\"}\n              animationShow={\"show-left 1s\"}\n            /\u003e\n          )}\n        \u003c/div\u003e\n      \u003c/div\u003e\n    );\n  }\n}\n\n```\n\n[![Edit react-leanimate example](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/rj3m0jq3o4)\n\n## Smooth component ![](http://img.badgesize.io/fredericheem/react-leanimate/master/src/Smooth.js.svg?compression=gzip)\n\nWhen a child component is added or removed, the parent node will have its width or height changed. Use the *Smooth* component to animate this transition.\n\nExample:\n\n```jsx\nimport React, { Component } from \"react\";\nimport Smooth from \"react-leanimate/Smooth\";\n\nclass ShowDetails extends Component {\n  state = {\n    show: false\n  };\n\n  render() {\n    const { state } = this;\n    return (\n      \u003cSmooth className=\"box-border\"\u003e\n        \u003cbutton onClick={() =\u003e this.setState({ show: !state.show })}\u003e\n          Show Details\n        \u003c/button\u003e\n        \u003cdiv\u003e\n          {state.show \u0026\u0026 \u003cdiv\u003eDetails here\u003c/div\u003e}\n        \u003c/div\u003e\n      \u003c/Smooth\u003e\n    );\n  }\n}\n```\n\n[![Edit react-leanimate \u003cSmooth/\u003e](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/3vx4l4qlxp)\n\n## Installing this library\n\nThe library is published under the *react-leanimate* name\n\n    $ npm i react-leanimate\n\n\n## Building this library\n\n[microbundle](https://github.com/developit/microbundle) is the underlying tool to produce size efficient bundles.\n\n```sh\n$ npm run build:lib\n\u003e microbundle -i src/Animate.js -i src/Smooth.js --external all --jsx React.createElement\n\nBuild output to dist:\n        609 B: Animate.js\n        575 B: Animate.m.js\n        673 B: Animate.umd.js\n        718 B: Smooth.js\n        684 B: Smooth.m.js\n        782 B: Smooth.umd.js\n ```\n\n## Modifying this library\n\nStart a development server using:\n\n    $ npm run build\n\nYou can also develop with [storybook](https://github.com/storybooks/storybook)\n\n    $ npm run storybook\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffredericheem%2Freact-leanimate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffredericheem%2Freact-leanimate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffredericheem%2Freact-leanimate/lists"}