ReactAwesome Slider

<AwesomeSlider/>~7KB compressed

React Awesome Slider is a 60fps, extendable, highly customisable, production ready javascript react component that renders an animated set of UI gallery sliders.

Fold Animation

Comedy Central — South Park

bojack

Fall Animation Styles

For this example we're importing the fall-animation style modules.

.jsx

import AwesomeSlider from 'react-awesome-slider'; import AwesomeSliderStyles from 'react-awesome-slider/src/styled/fall-animation.scss'; const Slider = ( <AwesomeSlider cssModule={AwesomeSliderStyles}> <div data-src="/path/to/image-0.jpg" /> <div data-src="/path/to/image-1.jpg" /> <div data-src="/path/to/image-2.jpg" /> <div data-src="/path/to/image-3.jpg" /> </AwesomeSlider> );

Styling the fold animation

The animation exit styling on the fall-animation .scss file is not that straight forward but you can easily customize it using the --fall CSS custom properties. Checkout the full style source here.

.scss

.aws-sld { --fall-animation-duration: 700ms; --fall-animation-angle: 16deg; --fall-scaling-in-from: 0.9; ... }

Customisation

Basic customization through the component's props and CSS custom-properties.

Source

Component's global props

    • true
    • true
    • false

CSS Custom Properties

    General

    • 60%
    • 770ms

    Arrows

    • 4px
    • 0px
    • 40px
    • #6a6a6a

    Controls

    • 10%
    • 25%
    • transparent
    • #6a6a6a
    • #6a6a6a

    Loader Bar

    • #851515
    • 6px
Avatar