1.1.2 ā€¢ Published 1 month ago

react-transition-scroll v1.1.2

Weekly downloads
-
License
MIT
Repository
github
Last release
1 month ago

react-transition-scroll

Easily & Beautifully create scroll transitions in react!

NPM JavaScript Style Guide

Introduction

react-transition-scroll is a lightweight library to easily and beautifully implement scroll animations/transition in react. It is built on top of the modern IntersectionObserver API. It covers most use cases for scroll animations and transitions.

Check out examples here!

Install

Npm:

npm install --save react-transition-scroll

Yarn:

yarn add --save react-transition-scroll

Usage

import React, { Component } from 'react'

import { TransitionScroll } from 'react-transition-scroll'
import 'react-transition-scroll/dist/index.css'

class Example extends Component {
  render() {
    return(
      <TransitionScroll options... >
        <YourComponentToAnimateOnScroll />
      </TransitionScroll>
    )
  }
}

Options

NameTypeDefaultDescription
thresholdnumber0Percentage of element that has to be in view to trigger transition (number between 0 and 100)
reAnimatebooleanfalseWhether to reanimate if element enters viewport again
baseStyleStyle Object{}Base styles to apply to transition element
hiddenStyleStyle Object{ opacity: 1, translate: '0 12px', filter: 'blur(4px)' }Styles to apply to transition element when hidden
showStyleStyle Object{ opacity: 0, translate: '0 0', filter: 'none' }Styles to apply to transition element when hidden
classNamestring''Classname to apply to the transition element
asstring'div'Wrapper HTML tag to render the transition element as

Features

šŸ˜®ā€šŸ’Ø Simple syntax
šŸ‘Œ Honors prefers-reduced-motion media query
šŸš€ Uses IntersectionObserver API (Blazingly fast)
ā›” 0 dependencies!

License

MIT Ā© alianza

1.1.2

1 month ago

1.1.1

2 months ago

1.1.0

2 months ago

1.0.13

3 months ago

1.0.12

3 months ago

1.0.11

3 months ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.10

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago