{"id":13402554,"url":"https://github.com/rnosov/react-reveal","last_synced_at":"2025-05-14T08:07:35.613Z","repository":{"id":38869784,"uuid":"70620812","full_name":"rnosov/react-reveal","owner":"rnosov","description":"Easily add reveal on scroll animations to your React app","archived":false,"fork":false,"pushed_at":"2023-03-01T09:48:48.000Z","size":11619,"stargazers_count":2726,"open_issues_count":94,"forks_count":182,"subscribers_count":16,"default_branch":"master","last_synced_at":"2025-05-05T14:45:55.466Z","etag":null,"topics":["animation","react-components","reveal","scroll-animations"],"latest_commit_sha":null,"homepage":"https://www.react-reveal.com/","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/rnosov.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2016-10-11T17:58:52.000Z","updated_at":"2025-04-30T01:33:15.000Z","dependencies_parsed_at":"2023-02-09T10:46:30.803Z","dependency_job_id":"5b91acf7-8339-407e-9add-89683d6b4408","html_url":"https://github.com/rnosov/react-reveal","commit_stats":{"total_commits":133,"total_committers":2,"mean_commits":66.5,"dds":0.007518796992481258,"last_synced_commit":"98d5c86b9bc6f4d071cc3cb10cd2e9d5377d100a"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rnosov%2Freact-reveal","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rnosov%2Freact-reveal/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rnosov%2Freact-reveal/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rnosov%2Freact-reveal/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rnosov","download_url":"https://codeload.github.com/rnosov/react-reveal/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253025411,"owners_count":21842415,"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-components","reveal","scroll-animations"],"created_at":"2024-07-30T19:01:17.557Z","updated_at":"2025-05-14T08:07:30.603Z","avatar_url":"https://github.com/rnosov.png","language":"JavaScript","funding_links":[],"categories":["JavaScript","效果类","UI Animation","📦 Legacy \u0026 Inactive Projects"],"sub_categories":["GraphQL"],"readme":"# React Reveal\n\n[React Reveal](https://www.react-reveal.com/) is\nan animation framework for React. It's MIT licensed, has a tiny footprint\nand written specifically for React in ES6. It can be used to create various cool reveal\non scroll animations in your application.\nIf you liked this package, don't forget to star\nthe [Github repository](https://github.com/rnosov/react-reveal).\n\n## Live Examples\n\nA number of simple effect examples:\n- [Fade](https://www.react-reveal.com/examples/common/fade/)\n- [Flip](https://www.react-reveal.com/examples/common/flip/)\n- [Rotate](https://www.react-reveal.com/examples/common/rotate/)\n- [Zoom](https://www.react-reveal.com/examples/common/zoom/)\n- [Bounce](https://www.react-reveal.com/examples/common/bounce/)\n- [Roll](https://www.react-reveal.com/examples/common/roll/)\n\nAlso, there are more complicated examples of [animated form errors](https://www.react-reveal.com/examples/advanced/form/) and a [todo app](https://www.react-reveal.com/examples/advanced/todo/).\n\n## Search Engine Visibility \n\n`react-reveal` is regularly checked against googlebot in the Google Search Console to make sure that googlebot can see the content in the revealed elements. \n\n## Full Documentation\n\nFor a full documentation please visit [online docs](https://www.react-reveal.com/docs/).\n\n## Installation\n\nIn the command prompt run:\n\n```sh\nnpm install react-reveal --save\n```\n\nAlternatively you may use `yarn`:\n\n```sh\nyarn add react-reveal\n```\n\n## Quick Start\n\nImport effects from [React Reveal](https://www.npmjs.com/package/react-reveal) to your project. Lets try `Zoom` effect first:\n\n```javascript\nimport Zoom from 'react-reveal/Zoom';\n```\n\nPlace the following code somewhere in your `render` method: \n\n```jsx\n\u003cZoom\u003e\n  \u003cp\u003eMarkup that will be revealed on scroll\u003c/p\u003e\n\u003c/Zoom\u003e\n```\n\nYou should see zooming animation that reveals text inside the tag. You can change this text to any JSX you want. If you place this code further down the page you'll see that it'd appear as you scroll down.\n\n## Revealing React Components\n\nYou may just wrap your custom React component with the effect of your choosing like so:\n\n```jsx\n\u003cZoom\u003e  \n  \u003cCustomComponent /\u003e\n\u003c/Zoom\u003e\n```\n\nIn such case, in the resulting `\u003cCustomComponent /\u003e` HTML markup will be wrapped in a `div` tag. If you would rather have a different HTML tag then wrap `\u003cCustomComponent /\u003e` in a tag of your choosing:\n\n```jsx\n\u003cZoom\u003e\n  \u003csection\u003e\n    \u003cCustomComponent /\u003e   \n  \u003c/section\u003e\n\u003c/Zoom\u003e\n```\n\nor if you want to customize `div` props:\n\n```jsx\n\u003cZoom\u003e\n  \u003cdiv className=\"some-class\"\u003e\n    \u003cCustomComponent /\u003e   \n  \u003c/div\u003e\n\u003c/Zoom\u003e\n```\n\n## Revealing Images\n\nIf you want to reveal an image you can wrap `img` tag with with the desired `react-reveal` effect:\n\n```jsx\n\u003cZoom\u003e\n  \u003cimg height=\"300\" width=\"400\" src=\"https://source.unsplash.com/random/300x400\" /\u003e\n\u003c/Zoom\u003e\n```\n\nIt would be a very good idea to specify width and height of any image you wish to reveal.\n\n## Children\n\n`react-reveal` will attach a reveal effect to each child it gets. In other words,\n\n```jsx\n\u003cZoom\u003e\n  \u003cdiv\u003eFirst Child\u003c/div\u003e\n  \u003cdiv\u003eSecond Child\u003c/div\u003e\n\u003c/Zoom\u003e\n```\n\nwill be equivalent to:\n\n```jsx\n\u003cZoom\u003e\n  \u003cdiv\u003eFirst Child\u003c/div\u003e\n\u003c/Zoom\u003e\n\u003cZoom\u003e\n  \u003cdiv\u003eSecond Child\u003c/div\u003e\n\u003c/Zoom\u003e  \n```\n\nIf you don't want this to happen, you should wrap multiple children in a `div` tag:\n\n```jsx\n\u003cZoom\u003e\n  \u003cdiv\u003e\n    \u003cdiv\u003eFirst Child\u003c/div\u003e\n    \u003cdiv\u003eSecond Child\u003c/div\u003e\n  \u003c/div\u003e\n\u003c/Zoom\u003e\n```\n\n\n## Server Side Rendering\n\n`react-reveal` supports server side rendering out of the box. In some cases, when the javascript bundle arrives much later than the HTML\u0026CSS it might cause a flickering. To prevent this `react-reveal` will not apply reveal effects on the initial load. \nAnother option is to apply gentle fadeout effect on the initial render. You can force it on all `react-reveal` elements by placing the following code somewhere near the entry point of your app:\n\n```jsx\nimport config from 'react-reveal/globals';\n\nconfig({ ssrFadeout: true });\n```\n\nOr you you can do it on a per element basis using `ssrFadeout` prop:\n\n```jsx\n\u003cZoom ssrFadeout\u003e\u003ch1\u003eContent\u003c/h1\u003e\u003c/Zoom\u003e\n```\n\nOne last option is to use `ssrReveal` prop. If enabled, this option will suppress both flickering and `ssrFadeout` effect. The unfortunate drawback of this option is that the revealed content will appear hidden to Googlebot and to anyone with javascript switched off. So it will makes sense for images and/or headings which are duplicated elsewhere on the page.\n\n## Forking This Package\n\nClone the this repository using the following command:\n\n```sh\ngit clone https://github.com/rnosov/react-reveal.git\n```\n\nIn the cloned directory, you can run following commands:\n\n```sh\nnpm install\n```\n\nInstalls required node modules\n\n```sh\nnpm run build\n```\n\nBuilds the package for production to the `dist` folder\n\n```sh\nnpm test\n```\n\nRuns tests\n\n## License\n\nCopyright © 2018 Roman Nosov. Project source code is licensed under the MIT license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frnosov%2Freact-reveal","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frnosov%2Freact-reveal","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frnosov%2Freact-reveal/lists"}