GithubHelp home page GithubHelp logo

rainstormza / react-awesome-slider Goto Github PK

View Code? Open in Web Editor NEW

This project forked from rcaferati/react-awesome-slider

0.0 1.0 0.0 38.07 MB

🖥️📱ReactJS 60fps light weight performant component that renders a animated set of production ready of UI image / media gallery sliders.

Home Page: https://caferati.me/demo/react-awesome-slider

License: MIT License

JavaScript 74.37% CSS 25.63%

react-awesome-slider's Introduction

React <AwesomeSlider />

Travis NPM

react-awesome-slider is a 60fps, extendable, highly customisable, production ready React Component that renders a media (image/video) gallery slider/carousel.

Basic usage

react-awesome-slider demo react-awesome-slider demo

Scale-out and Fold-out animation recipes

react-awesome-slider demo react-awesome-slider demo

Touch enabled

react-awesome-slider demo

Live demo

Checkout the CSS customizer at my portfolio

Installing

npm install --save react-awesome-slider

or

yarn add react-awesome-slider

Examples

Basic usage with and plain CSS

  import AwesomeSlider from 'react-awesome-slider';
  import 'react-awesome-slider/dist/styles.css';

  const slider = (
    <AwesomeSlider>
      <div data-src="/path/to/image-0.png" />
      <div data-src="/path/to/image-1.png" />
      <div data-src="/path/to/image-2.jpg" />
    </AwesomeSlider>
  );

Basic usage with CSS Modules

  import AwesomeSlider from 'react-awesome-slider';
  import AwsSliderStyles from 'react-awesome-slider/src/styles.scss';

  const slider = (
    <AwesomeSlider cssModule={styles}>
      <div data-src="/path/to/image-0.png" />
      <div data-src="/path/to/image-1.png" />
      <div data-src="/path/to/image-2.jpg" />
    </AwesomeSlider>
  );

Key Features

  • Look and feel customisable and extendable via SASS and CSS Variables (custom-properties) (scss main file)
  • Media pre-loader
  • Touch enabled
  • 60fps animations
  • Animated transition recipes
  • Extendable via custom plugin HOC components

Main Props

Attributes Type Default Description
className string null Add a className to the component container
cssModule object null CSS Module object if you choose to use this styling approach
name string awesome-slider Unique name of the rendered slider. Useful if you're navigating between multiple pages that contains a slider component.
selected number 0 Sets the current active/selected screen
onFirstMount function null Runs on componentDidMount passing the slider reference as an argument
onTransitionEnd function null Runs on at the slider transition end event passing the slider reference as an argument
onTransitionStart function null Runs on slider transition start passing the slider reference as an argument
startupScreen node null Set's the startup screen element to be shown before the first screen is loaded

Contribute

If you have an idea for a missing feature or animation just craft your own hoc feature or animation style and send it up via PR to the src/components folder.

Author

Rafael Caferati

License

MIT. Copyright (c) 2018 Rafael Caferati.

react-awesome-slider's People

Contributors

rcaferati avatar

Watchers

Supakorn Thongtra avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.