npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-crossfade-responsive

v1.2.0

Published

Made with create-react-library

Downloads

10

Readme

react-crossfade-responsive

Made with create-react-library

NPM React JavaScript Style Guide

Works with React v16.8 and above.

Please read before using. This is my first publication of a React Component of NPM so it may not be perfect.

This is a very easy-to-use crossfade carousel. I created this one because I experienced in most of the cases issues when using the other ones. (Some of them makes white blinks during the transitions, especially on Safari browsers).

It was built with React functional components & React Hooks.

Install


npm install --save react-crossfade-responsive

Usage


import  Crossfade  from  'react-crossfade-responsive'

const  App = () => {

return  <Crossfade  images=[<arrayOfImages>]  />

}

export  default  App

To use it, just provide an array of images to the component and pass it as a prop called "images". By default it has 3 random images so you can try instantly.

You can set a specific width and height by setting these props :

<Crossfade images={yourArray} height='300px' width='900px' />

In the case that you use specific dimensions, it's better to place the component inside a container with a margin: 0 auto; (for example) in order to justify it in the center.

You can also set a specific horizontal rate and vertical rate by setting these props :

<Crossfade images={yourArray} xRate='90%' yRate='90%' />

Theses rate allow you to control in percentage the span of the component.

By default, all these props are in order to provide a perfect full screen crossfade carousel.

The component is set as position: relative, so you can put it inside custom container to adjust it.

It is 100% responsive and will adapt to any height/width.

You can customize the interval and the transition duration setting the interval and transition props:

<Crossfade images={yourArray} interval='4000' transition='2000' />

(1000 = 1 second)

By default, interval set on 5000 and transition is set on 3000.

Demo

You can see an example of this crossfade by visiting this page >> demo page

API

| Name | Required | Type | Default | | ---------- | -------- | ------ | ------------------- | | images | no | array | [<3 random images>] | | height | no | string | 97vh | | width | no | string | 100% | | yRate | no | string | 100% | | xRate | no | string | 100% | | interval | no | string | 5000 | | transition | no | string | 3000 |

Repo

See the repo: Github page

License

MIT © a-rolland