{"id":24560648,"url":"https://github.com/azganoth/simple-motion-react","last_synced_at":"2026-04-12T11:44:29.767Z","repository":{"id":273286724,"uuid":"916342198","full_name":"Azganoth/simple-motion-react","owner":"Azganoth","description":"A lightweight React transition library for animating component lifecycle changes.","archived":false,"fork":false,"pushed_at":"2025-07-29T23:55:40.000Z","size":535,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-24T20:47:47.440Z","etag":null,"topics":["motion","react","transition"],"latest_commit_sha":null,"homepage":"https://simple-motion-react.vercel.app","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/Azganoth.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"docs/Contributing.mdx","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-01-13T22:59:01.000Z","updated_at":"2025-07-29T23:55:12.000Z","dependencies_parsed_at":"2025-01-20T02:21:16.218Z","dependency_job_id":"c271cbd4-5929-433e-8f6b-ee59722bab1d","html_url":"https://github.com/Azganoth/simple-motion-react","commit_stats":null,"previous_names":["azganoth/simple-motion-react"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/Azganoth/simple-motion-react","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Azganoth%2Fsimple-motion-react","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Azganoth%2Fsimple-motion-react/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Azganoth%2Fsimple-motion-react/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Azganoth%2Fsimple-motion-react/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Azganoth","download_url":"https://codeload.github.com/Azganoth/simple-motion-react/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Azganoth%2Fsimple-motion-react/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31713876,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-12T06:22:27.080Z","status":"ssl_error","status_checked_at":"2026-04-12T06:21:52.710Z","response_time":58,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["motion","react","transition"],"created_at":"2025-01-23T07:17:24.139Z","updated_at":"2026-04-12T11:44:29.735Z","avatar_url":"https://github.com/Azganoth.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @simple-motion/react\n\n[![codecov](https://codecov.io/gh/Azganoth/simple-motion-react/graph/badge.svg?token=EMUCLMP1PU)](https://codecov.io/gh/Azganoth/simple-motion-react)\n\nA lightweight React transition library for animating component lifecycle changes.\n\n---\n\n## Features\n\n- **Declarative API**: Simple and intuitive API for handling transitions.\n- **Lifecycle Control**: Hooks for each phase of the transition (`entering`, `entered`, `exiting`, `exited`).\n- **CSS Transitions**: Easily apply CSS classes for animations.\n- **Group Animations**: Animate a list of components as they are added or removed.\n- **Switchable Animations**: Seamlessly transition between two components.\n- **Lightweight**: Small and efficient with zero runtime dependencies, ensuring a minimal impact on your bundle size.\n\n[Documentation](https://simple-motion-react.vercel.app/)\n\n## Installation\n\n```bash\nnpm install @simple-motion/react\n```\n\n```bash\npnpm add @simple-motion/react\n```\n\n## Usage\n\n### Transition\n\nThe `Transition` component is the foundation of the library, allowing you to animate a component's mount and unmount lifecycle.\n\n```typescript\nimport { Transition } from '@simple-motion/react';\n\nfunction App() {\n  const [inProp, setInProp] = useState(true);\n\n  return (\n    \u003c\u003e\n      \u003cbutton onClick={() =\u003e setInProp(!inProp)}\u003e\n        Click to {inProp ? 'Exit' : 'Enter'}\n      \u003c/button\u003e\n      \u003cTransition in={inProp} timeout={300}\u003e\n        {phase =\u003e (\n          \u003cdiv style={{\n            transition: `opacity 300ms`,\n            opacity: phase === 'exiting' || phase === 'exited' ? 0 : 1\n          }}\u003e\n            I'm a fade Transition!\n          \u003c/div\u003e\n        )}\n      \u003c/Transition\u003e\n    \u003c/\u003e\n  );\n}\n```\n\n### CSSTransition\n\nThe `CSSTransition` component extends the `Transition` component, providing a way to apply CSS classes for animations.\n\n```typescript\nimport { CSSTransition } from '@simple-motion/react';\nimport './styles.css';\n\nfunction App() {\n  const [inProp, setInProp] = useState(true);\n\n  return (\n    \u003c\u003e\n      \u003cbutton onClick={() =\u003e setInProp(!inProp)}\u003e\n        Click to {inProp ? 'Exit' : 'Enter'}\n      \u003c/button\u003e\n      \u003cCSSTransition in={inProp} timeout={300} classNames=\"fade\"\u003e\n        \u003cdiv\u003eI'm a CSS Transition!\u003c/div\u003e\n      \u003c/CSSTransition\u003e\n    \u003c/\u003e\n  );\n}\n```\n\nAnd in your CSS file:\n\n```css\n.fade-enter {\n  opacity: 0;\n}\n.fade-enter-active {\n  opacity: 1;\n  transition: opacity 300ms;\n}\n.fade-exit {\n  opacity: 1;\n}\n.fade-exit-active {\n  opacity: 0;\n  transition: opacity 300ms;\n}\n```\n\n### TransitionGroup\n\nThe `TransitionGroup` component manages a set of `Transition` or `CSSTransition` components in a list.\n\n```typescript\nimport { TransitionGroup, CSSTransition } from '@simple-motion/react';\nimport './styles.css';\n\nfunction App() {\n  const [items, setItems] = useState([\n    { id: 1, text: 'Item 1' },\n    { id: 2, text: 'Item 2' }\n  ]);\n\n  const addItem = () =\u003e {\n    const id = Date.now();\n    setItems(prevItems =\u003e [...prevItems, { id, text: `Item ${id}` }]);\n  };\n\n  const removeItem = (id) =\u003e {\n    setItems(prevItems =\u003e prevItems.filter(item =\u003e item.id !== id));\n  };\n\n  return (\n    \u003c\u003e\n      \u003cbutton onClick={addItem}\u003eAdd Item\u003c/button\u003e\n      \u003cTransitionGroup\u003e\n        {items.map(({ id, text }) =\u003e (\n          \u003cCSSTransition key={id} timeout={500} classNames=\"fade\"\u003e\n            \u003cdiv\u003e\n              {text}\n              \u003cbutton onClick={() =\u003e removeItem(id)}\u003eRemove\u003c/button\u003e\n            \u003c/div\u003e\n          \u003c/CSSTransition\u003e\n        ))}\n      \u003c/TransitionGroup\u003e\n    \u003c/\u003e\n  );\n}\n```\n\n### TransitionSwitch\n\nThe `TransitionSwitch` component is used to transition between two components.\n\n```typescript\nimport { TransitionSwitch, CSSTransition } from '@simple-motion/react';\nimport './styles.css';\n\nfunction App() {\n  const [showFirst, setShowFirst] = useState(true);\n\n  return (\n    \u003c\u003e\n      \u003cbutton onClick={() =\u003e setShowFirst(!showFirst)}\u003e\n        Switch\n      \u003c/button\u003e\n      \u003cTransitionSwitch\u003e\n        \u003cCSSTransition\n          key={showFirst ? 'first' : 'second'}\n          timeout={500}\n          classNames=\"fade\"\n        \u003e\n          \u003cdiv\u003e{showFirst ? 'First Component' : 'Second Component'}\u003c/div\u003e\n        \u003c/CSSTransition\u003e\n      \u003c/TransitionSwitch\u003e\n    \u003c/\u003e\n  );\n}\n```\n\n## Development\n\nTo get started with developing `simple-motion-react`:\n\n1. **Clone the repository**\n2. **Install dependencies**: `pnpm install`\n3. **Run Storybook**: `pnpm storybook`\n4. **Run tests**: `pnpm test`\n\n## License\n\nThis project is licensed under the MIT License. See the [LICENSE](./LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fazganoth%2Fsimple-motion-react","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fazganoth%2Fsimple-motion-react","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fazganoth%2Fsimple-motion-react/lists"}