{"id":13626445,"url":"https://github.com/kitze/react-genie","last_synced_at":"2025-04-04T12:09:52.428Z","repository":{"id":24064723,"uuid":"100491718","full_name":"kitze/react-genie","owner":"kitze","description":"A set of React components for animating elements as they scroll into the viewport","archived":false,"fork":false,"pushed_at":"2023-05-25T15:07:31.000Z","size":1368,"stargazers_count":744,"open_issues_count":34,"forks_count":19,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-03-28T11:11:12.474Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://codesandbox.io/s/react-genie-example-8xfsc","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/kitze.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}},"created_at":"2017-08-16T13:21:36.000Z","updated_at":"2024-12-20T05:05:15.000Z","dependencies_parsed_at":"2024-01-08T08:00:15.310Z","dependency_job_id":"e224c494-e7da-4bee-8aff-9e02a7a0a536","html_url":"https://github.com/kitze/react-genie","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kitze%2Freact-genie","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kitze%2Freact-genie/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kitze%2Freact-genie/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kitze%2Freact-genie/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kitze","download_url":"https://codeload.github.com/kitze/react-genie/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247174454,"owners_count":20896078,"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-01T21:02:18.853Z","updated_at":"2025-04-04T12:09:52.395Z","avatar_url":"https://github.com/kitze.png","language":"TypeScript","funding_links":[],"categories":["TypeScript","目录"],"sub_categories":[],"readme":"# 🧞‍♂️ react-genie\n\n### 🙋‍♂️ Made by [@thekitze](https://twitter.com/thekitze)  \n\n### Other projects:\n- 💻 [Sizzy](https://sizzy.co) - A browser for designers and developers, focused on responsive design\n- 🏫 [React Academy](https://reactacademy.io) - Interactive React and GraphQL workshops\n- 🔮 [Glink](https://glink.so) - Changelogs, Roadmap, User Requests\n- 🐶 [Benji](https://benji.so) - Ultimate wellness and productivity platform\n- 🤖 [JSUI](https://github.com/kitze/JSUI) - A powerful UI toolkit for managing JavaScript apps\n- 📹 [YouTube Vlog](https://youtube.com/kitze) - Follow my journey\n\n\u003ca href=\"https://zerotoshipped.com\"\u003e\u003cimg style=\"width:450px\" src=\"https://i.ibb.co/WKQPDv5/twitter-image.jpg\" alt=\"Zero To Shipped\"\u003e\u003c/a\u003e\n\n## Used on [sizzy.co](https://sizzy.co)\n![animation](https://i.imgur.com/0kK9C2P.gif)\n\n## CodeSandbox\nhttps://codesandbox.io/s/react-genie-example-8xfsc\n\n## Demo\nhttps://8xfsc.csb.app/\n\n\n## Dependencies\n- styled-components\n- layout-styled-components\n- react-animations\n- react-intersection-observer\n\n## Usage\n\n`yarn add react-genie`\n\nJust render the `RevealGlobalStyles` component anywhere, so it will add the class names for the animations:\n\n```jsx\nimport {RevealGlobalStyles} from 'react-genie'\n\nconst App = () =\u003e {\n  return (\n    \u003cdiv\u003e\n      \u003cRevealGlobalStyles /\u003e\n      \u003cdiv\u003e rest of the app \u003c/div\u003e\n    \u003c/div\u003e\n  );\n};\n```\n\n\n### Default animation:\n```jsx\nimport {Reveal} from 'react-genie';\n\n\u003cReveal\u003e\n  \u003ch1\u003eThe default animation is fade in\u003c/h1\u003e\n\u003c/Reveal\u003e\n```\n\n## Props:\n```js\n{\n  animation?: string; // animation class name\n  delay?: number; // animation delay\n  mode?: RevealMode; // \"clone\" or \"wrap\"\n  debugName?: string; // if you specify it, you will get console logs\n  style?: CSSObject; // extra styles\n  onShowDone?: () =\u003e void; // callback after show\n}\n```\n\n\n### Specifying animation using the `animation` prop:\n```jsx\nimport {Reveal, Animation} from 'react-genie';\n\n\u003cReveal animation={Animation.SlideInLeft}\u003e\n  \u003ch1\u003eThis title will slide in from the left\u003c/h1\u003e\n\u003c/Reveal\u003e\n```\nHint: you can also pass your own class name here if you have custom animations.\n\n### Wrap vs Clone\n\nThe default `mode` is `wrap`, so the children element will be wrapped in an additional div.\nIf you don't want that additional div, you can use `clone` or `RevealMode.Clone`.\n\n```jsx\nimport {Reveal, RevealMode} from 'react-genie';\n\n\u003cReveal mode={RevealMode.Clone}\u003e\n  \u003ch1\u003eThis h1 will be cloned instead of wrapped\u003c/h1\u003e\n\u003c/Reveal\u003e\n```\n\nIn order for `clone` to work your element needs to accept `className`, `style`, and `ref`, as props. So, if you're trying to clone custom components, make sure they support these props.\n\n### The `AnimatedTitle` component\n```jsx\nimport {Reveal, AnimatedTitle} from 'react-genie';\n\n\u003cAnimatedTitle\u003e\n  This sentence will animate in word by word\n\u003c/AnimatedTitle\u003e\n```\n\nThe `AnimatedTitle` component will split the `children` prop word by word (so it should be a string), and animate each word with a delay in between.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkitze%2Freact-genie","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkitze%2Freact-genie","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkitze%2Freact-genie/lists"}