{"id":13433321,"url":"https://github.com/brunnolou/react-morph","last_synced_at":"2025-05-14T20:04:20.617Z","repository":{"id":29358068,"uuid":"121180950","full_name":"brunnolou/react-morph","owner":"brunnolou","description":"Morphing Ui transitions made simple","archived":false,"fork":false,"pushed_at":"2022-12-12T12:34:24.000Z","size":11853,"stargazers_count":2549,"open_issues_count":23,"forks_count":44,"subscribers_count":19,"default_branch":"master","last_synced_at":"2025-04-06T05:14:27.915Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://brunnolou.github.io/react-morph","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/brunnolou.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-02-12T00:14:52.000Z","updated_at":"2025-03-30T17:44:15.000Z","dependencies_parsed_at":"2022-07-09T14:46:26.064Z","dependency_job_id":null,"html_url":"https://github.com/brunnolou/react-morph","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brunnolou%2Freact-morph","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brunnolou%2Freact-morph/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brunnolou%2Freact-morph/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brunnolou%2Freact-morph/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/brunnolou","download_url":"https://codeload.github.com/brunnolou/react-morph/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248688551,"owners_count":21145765,"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-07-31T02:01:24.140Z","updated_at":"2025-04-13T08:59:47.574Z","avatar_url":"https://github.com/brunnolou.png","language":"TypeScript","funding_links":[],"categories":["TypeScript","JavaScript","Components"],"sub_categories":["Animation"],"readme":"# React Morph ️🦋\n\n#### Morphing UI transitions made simple\n\n[![npm version](https://badge.fury.io/js/react-morph.svg?v0)](https://www.npmjs.com/package/react-morph)\n\n\u003cimg src=\"https://github.com/brunnolou/react-morph/blob/master/examples/react-morph-simple.gif\" width=\"300\"\u003e\n\nMagically animates one element into another just by tagging the first and last state.\n\n## Getting Started 🐛\n\n```sh\nnpm install react-morph\n# or\nyarn add react-morph\n```\n\nImport the `useMorph` hook.\n\n```js\nconst morph = useMorph(options);\n```\n\nThen spread the props to the elements you want to morph.\n\n```jsx\n\u003cimg {...morph} src=\"larva.png\" width=\"50\"\u003e\n```\n\n```jsx\n\u003cimg {...morph} src=\"butterfly.png\" width=\"80\"\u003e\n```\n\n\u003e Make sure you have just **ONE element rendered at same time**.\n\n## Simple Example 🦋\n\n1. Create two states as you normally would (HTML + CSS).\n2. Call `useMorph` hook.\n3. Spread the elements you want to morph with `{...morph}`\n4. Add and remove the element from the DOM\n\n```js\nimport React from 'react';\nimport { useMorph } from 'react-morph';\n```\n\n```jsx\n() =\u003e {\n  // Handle toggle state as you normally would.\n  const [toggle, setToggle] = useState(true);\n  const morph = useMorph();\n\n  return (\n    \u003cdiv\u003e\n      \u003cbutton onClick={() =\u003e setToggle(!toggle)}\u003eLet's morph!\u003c/button\u003e\n      \u003cbr /\u003e\n\n      {toggle ? (\n        \u003cimg {...morph} src={larva} width=\"30\" /\u003e\n      ) : (\n        \u003cimg {...morph} src={butterfly} width=\"80\" /\u003e\n      )}\n    \u003c/div\u003e\n  );\n};\n```\n\n## [Documentation](https://brunnolou.github.io/react-morph)\n\nPlease check the [documentation](https://brunnolou.github.io/react-morph).\n\n## Features 🌟\n\n- Simplicity\n- No hardcoded absolute positions\n- All GPU accelerated props\n- No layout or paint browser rendering\n\n## Live Demos\n\n- [Hello world](https://codesandbox.io/s/yqyymqn8z1)\n- [Apple App Store](https://codesandbox.io/s/7ywk4o0xmj)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrunnolou%2Freact-morph","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrunnolou%2Freact-morph","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrunnolou%2Freact-morph/lists"}