All Projects → alexvcasillas → react-spring-pop

alexvcasillas / react-spring-pop

Licence: other
Animate React elements when they enter the viewport with physics based animations

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to react-spring-pop

react-awesome-reveal
React components to add reveal animations using the Intersection Observer API and CSS Animations.
Stars: ✭ 564 (+3217.65%)
Mutual labels:  viewport, intersection-observer
vue-observable
IntersectionObserver, MutationObserver and PerformanceObserver in Vue.js
Stars: ✭ 24 (+41.18%)
Mutual labels:  viewport, intersection-observer
svelte-intersection-observer
Detect if an element is in the viewport using the Intersection Observer API
Stars: ✭ 151 (+788.24%)
Mutual labels:  viewport, intersection-observer
vue-in-viewport-mixin
Vue 2 mixin to determine when a DOM element is visible in the client window
Stars: ✭ 99 (+482.35%)
Mutual labels:  viewport, intersection-observer
React Intersection Observer
React implementation of the Intersection Observer API to tell you when an element enters or leaves the viewport.
Stars: ✭ 2,689 (+15717.65%)
Mutual labels:  viewport, intersection-observer
svelte-inview
A Svelte action that monitors an element enters or leaves the viewport.🔥
Stars: ✭ 358 (+2005.88%)
Mutual labels:  viewport, intersection-observer
AnimatedPullToRefresh-master
A Cool pull to refresh widget provided with character animation in header with user defined text. Customise your widget and show off your home screen!!
Stars: ✭ 38 (+123.53%)
Mutual labels:  animated
starfish
Intersect multiple VCF files with haplotype awareness
Stars: ✭ 19 (+11.76%)
Mutual labels:  intersection
komorebi
A beautiful and customizable wallpaper manager for Linux
Stars: ✭ 231 (+1258.82%)
Mutual labels:  animated
clipper
Implementation for the clipper library in rhino and grasshopper.
Stars: ✭ 55 (+223.53%)
Mutual labels:  intersection
ML IDCard Segmentation-TF-Keras
Machine Learning Project to identify an ID Card on an image
Stars: ✭ 38 (+123.53%)
Mutual labels:  intersection
MovieCards
React App that uses TMDb API to display movie data. Try it out! ->
Stars: ✭ 38 (+123.53%)
Mutual labels:  react-spring
hyperdiff
Find common, removed and added element between two collections.
Stars: ✭ 14 (-17.65%)
Mutual labels:  intersection
animation-wrapper-view
Declarative animations with imperative controls for RN/RNW.
Stars: ✭ 53 (+211.76%)
Mutual labels:  animated
react-context-responsive
A package that provides a responsive context to your application, using React Context API.
Stars: ✭ 25 (+47.06%)
Mutual labels:  viewport
interval
This PHP library provides some tools to handle intervals. For instance, you can compute the union or intersection of two intervals.
Stars: ✭ 25 (+47.06%)
Mutual labels:  intersection
Bibata Cursor Rainbow
'Semi-Animated' Bibata cursors with rainbow colors
Stars: ✭ 18 (+5.88%)
Mutual labels:  animated
react-spring-carousel-js
A new Carousel experience for the modern Web
Stars: ✭ 82 (+382.35%)
Mutual labels:  react-spring
React-Native-Interactive-Card
Interactive Card Component for React Native
Stars: ✭ 29 (+70.59%)
Mutual labels:  animated
livebook
Flip pages with drag, made with React-use-gesture
Stars: ✭ 37 (+117.65%)
Mutual labels:  react-spring

React Spring POP!

React Spring POP! Logo

Contents

  1. Introduction
  2. Motivation
  3. Installation
  4. Basic usage
  5. Demo
  6. Others

Introduction

React Spring POP! is a physics based animation library for your React application. It uses React Spring to generate performant off-thread calculations for the physics based animations and the Intersection Observer API with the @alexvcasillas/use-observer library which both of them are pretty cool and my defaults to go.

Motivation

I started working on animating some components when they appeared at the viewport to make cool landing pages animations and other cool applications' stuff. Then I realized that this could potentially be useful for many other developers out there in the wild, so I decided to create this library just for you to have this things out-of-the-box and not having to deal with configs and bla bla bla.

Installation

yarn add react-spring-pop react react-spring
npm i -s react-spring-pop react react-spring

This project has two peer dependecies which are: React and React Spring. You will need both of the installed in your project in order for React Spring POP! to work properly.

Basic usage

import { PopIn } from "react-spring-pop";

function App() {
  return (
    <PopIn>
      {/* Whatever your want to pop-in here! */}
    </PopIn>
  )
}

Demo

You can check a demo featuring all of the animations on the always marvelous CodeSandbox.io

Pop Animations

React Spring POP! comes out-of-the-box with a few components to deal with pop in animations. Those components are the following.

  • PopIn
  • PopInLeft
  • PopInRight
  • PopInTop
  • PopInBottom

This components will accept the following props to configure a little its behaviour:

prop: element;
  type: string;
  default: 'div';

prop: once;
  type: boolean;
  default: false;

prop: threshold;
  type: number;
  default: 0;
  min: 0;
  max: 1;

prop: tension;
  type: number;
  default: 180;
  min: 1;
  max: 500;

prop: friccion;
  type: number;
  default: 12;
  min: 1;
  max: 500;

prop: mass;
  type: number;
  default: 1;
  min: 1;
  max: 500;

The element property indicates which kind of HTML element would you like to generate for this animated component.

The once property indicates if the animation should be only triggered once and no more, so it will only get triggered the first time the element is on the viewport with the given threshold.

The threshold property indicates how much of the component needs to be displayed within the viewport to trigger the animation. It will take a number from 0 to 1 to indicate the percentage of the component that's on the viewport, meaning that 0.5 will be equals to the 50% of the component.

The tension property indicates the spring energetic load.

The friccion property indicates the spring resistance.

The mass property indicates the spring mass.

Fade Animations

React Spring POP! comes out-of-the-box with a few components to deal with fade in animations. Those components are the following.

  • FadeIn
  • FadeInLeft
  • FadeInRight
  • FadeInTop
  • FadeInBottom

This components will accept the following prop to configure a little its behaviour:

prop: element;
  type: string;
  default: 'div';

prop: once;
  type: boolean;
  default: false;

prop: threshold;
  type: number;
  default: 0;
  min: 0;
  max: 1;

The element property indicates which kind of HTML element would you like to generate for this animated component.

The once property indicates if the animation should be only triggered once and no more, so it will only get triggered the first time the element is on the viewport with the given threshold.

The threshold property indicates how much of the component needs to be displayed within the viewport to trigger the animation. It will take a number from 0 to 1 to indicate the percentage of the component that's on the viewport, meaning that 0.5 will be equals to the 50% of the component.

Bounce Animations

React Spring POP! comes out-of-the-box with a few components to deal with bounce in animations. Those components are the following.

  • BounceInLeft
  • BounceInRight
  • BounceInTop
  • BounceInBottom

This components will accept the following props to configure a little its behaviour:

prop: element;
  type: string;
  default: 'div';

prop: once;
  type: boolean;
  default: false;

prop: threshold;
  type: number;
  default: 0;
  min: 0;
  max: 1;

prop: tension;
  type: number;
  default: 180;
  min: 1;
  max: 500;

prop: friccion;
  type: number;
  default: 12;
  min: 1;
  max: 500;

prop: mass;
  type: number;
  default: 1;
  min: 1;
  max: 500;

The element property indicates which kind of HTML element would you like to generate for this animated component.

The once property indicates if the animation should be only triggered once and no more, so it will only get triggered the first time the element is on the viewport with the given threshold.

The threshold property indicates how much of the component needs to be displayed within the viewport to trigger the animation. It will take a number from 0 to 1 to indicate the percentage of the component that's on the viewport, meaning that 0.5 will be equals to the 50% of the component.

The tension property indicates the spring energetic load.

The friccion property indicates the spring resistance.

The mass property indicates the spring mass.

Others

If you want a more CSS-in-JS approach I've also developed Animated Styled Components which makes use of styled-components and pure CSS animation keyframes and it comes with a lot of ready to drop in animations!

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