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.

Scale Animation

Comedy Central — South Park

south park

Scale Animation Styles

For this example we're importing the scale-out-animation overwritten style modules.

.jsx

import AwesomeSlider from 'react-awesome-slider'; import AwesomeSliderStyles from 'react-awesome-slider/src/styled/scale-out-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> );

How to extend it

The animation exit styling on the scale-out-animation .scss file is pretty straight forward. We just apply the scaling down on exit moveLeft and exit moveRight classes of the active box container.

.scss

.aws-sld { &--exit { &.aws-sld--moveRight, &.aws-sld--moveLeft { animation: scaleOut var(--slider-transition-duration) both var(--transition-bezier); } } } @keyframes scaleOut { to { transform: scale(0.85); } }

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%
    • 670ms

    Arrows

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

    Controls

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

    Loader Bar

    • #851515
    • 6px
Avatar