All Projects → rnosov → React Reveal

rnosov / React Reveal

Licence: mit
Easily add reveal on scroll animations to your React app

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to React Reveal

react-awesome-reveal
React components to add reveal animations using the Intersection Observer API and CSS Animations.
Stars: ✭ 564 (-75.28%)
Mutual labels:  react-components, reveal
Primereact
The Most Complete React UI Component Library
Stars: ✭ 2,393 (+4.86%)
Mutual labels:  react-components
React Step Progress Bar
A library to create stunning progress bars and steps in React 🌡
Stars: ✭ 140 (-93.87%)
Mutual labels:  react-components
React Formik Ui
A simple component library, composed out of pure HTML form elements to make your live easier composing forms with Formik and React
Stars: ✭ 154 (-93.25%)
Mutual labels:  react-components
Fluentui
Fluent UI web represents a collection of utilities, React components, and web components for building web applications.
Stars: ✭ 12,587 (+451.58%)
Mutual labels:  react-components
Shine Design
为开发者、设计师和产品经理准备的 UI 设计语言
Stars: ✭ 157 (-93.12%)
Mutual labels:  react-components
React Code Blocks
React code blocks and code snippet components
Stars: ✭ 135 (-94.08%)
Mutual labels:  react-components
Terra Core
Terra offers a set of configurable React components designed to help build scalable and modular application UIs. This UI library was created to solve real-world issues in projects we work on day to day.
Stars: ✭ 167 (-92.68%)
Mutual labels:  react-components
Materials
官方精品物料仓库
Stars: ✭ 159 (-93.03%)
Mutual labels:  react-components
React Stylesheet
Component based styling for your React applications
Stars: ✭ 150 (-93.43%)
Mutual labels:  react-components
Fundamental React
React implementation of the reusable component library designed in Fundamental Library Styles
Stars: ✭ 148 (-93.51%)
Mutual labels:  react-components
Synergy
Synergy is a framework for building modular, configurable and scalable UI components for React-DOM projects
Stars: ✭ 146 (-93.6%)
Mutual labels:  react-components
React Spinners Kit
A collection of loading spinners with React.js
Stars: ✭ 158 (-93.08%)
Mutual labels:  react-components
Extract React Types
One stop shop to document your react components.
Stars: ✭ 141 (-93.82%)
Mutual labels:  react-components
React Rough
🐇 React Components for Rough.js
Stars: ✭ 164 (-92.81%)
Mutual labels:  react-components
Style Guide
🎨 Brainly Front-End Style Guide
Stars: ✭ 139 (-93.91%)
Mutual labels:  react-components
React Border Wrapper
A wrapper for placing elements along div borders.
Stars: ✭ 147 (-93.56%)
Mutual labels:  react-components
Styled Bootstrap
💅🏻 A styled-component implementation of Bootstrap
Stars: ✭ 154 (-93.25%)
Mutual labels:  react-components
Semantic Ui React
The official Semantic-UI-React integration
Stars: ✭ 12,561 (+450.44%)
Mutual labels:  react-components
Ej2 React Ui Components
Syncfusion React UI components library offer more than 50+ cross-browser, responsive, and lightweight react UI controls for building modern web applications.
Stars: ✭ 166 (-92.73%)
Mutual labels:  react-components

React Reveal

React Reveal is an animation framework for React. It's MIT licensed, has a tiny footprint and written specifically for React in ES6. It can be used to create various cool reveal on scroll animations in your application. If you liked this package, don't forget to star the Github repository.

Live Examples

A number of simple effect examples:

Also, there are more complicated examples of animated form errors and a todo app.

Search Engine Visibility

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.

Full Documentation

For a full documentation please visit online docs.

Installation

In the command prompt run:

npm install react-reveal --save

Alternatively you may use yarn:

yarn add react-reveal

Quick Start

Import effects from React Reveal to your project. Lets try Zoom effect first:

import Zoom from 'react-reveal/Zoom';

Place the following code somewhere in your render method:

<Zoom>
  <p>Markup that will be revealed on scroll</p>
</Zoom>

You 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.

Revealing React Components

You may just wrap your custom React component with the effect of your choosing like so:

<Zoom>  
  <CustomComponent />
</Zoom>

In such case, in the resulting <CustomComponent /> HTML markup will be wrapped in a div tag. If you would rather have a different HTML tag then wrap <CustomComponent /> in a tag of your choosing:

<Zoom>
  <section>
    <CustomComponent />   
  </section>
</Zoom>

or if you want to customize div props:

<Zoom>
  <div className="some-class">
    <CustomComponent />   
  </div>
</Zoom>

Revealing Images

If you want to reveal an image you can wrap img tag with with the desired react-reveal effect:

<Zoom>
  <img height="300" width="400" src="https://source.unsplash.com/random/300x400" />
</Zoom>

It would be a very good idea to specify width and height of any image you wish to reveal.

Children

react-reveal will attach a reveal effect to each child it gets. In other words,

<Zoom>
  <div>First Child</div>
  <div>Second Child</div>
</Zoom>

will be equivalent to:

<Zoom>
  <div>First Child</div>
</Zoom>
<Zoom>
  <div>Second Child</div>
</Zoom>  

If you don't want this to happen, you should wrap multiple children in a div tag:

<Zoom>
  <div>
    <div>First Child</div>
    <div>Second Child</div>
  </div>
</Zoom>

Server Side Rendering

react-reveal supports server side rendering out of the box. In some cases, when the javascript bundle arrives much later than the HTML&CSS it might cause a flickering. To prevent this react-reveal will not apply reveal effects on the initial load. Another 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:

import config from 'react-reveal/globals';

config({ ssrFadeout: true });

Or you you can do it on a per element basis using ssrFadeout prop:

<Zoom ssrFadeout><h1>Content</h1></Zoom>

One 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.

Forking This Package

Clone the this repository using the following command:

git clone https://github.com/rnosov/react-reveal.git

In the cloned directory, you can run following commands:

npm install

Installs required node modules

npm run build

Builds the package for production to the dist folder

npm test

Runs tests

License

Copyright © 2018 Roman Nosov. Project source code is licensed under the MIT license.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].