Slider

Type: React component

Slider creates a full size container (with flex: 1) in which child Slide components should be placed. It shows a single Slide at once, based on the activeSlideIndex prop. Whenever that prop changes after the initial render, a dynamic CSS animation is used to translate each slide on the x-axis.

Props

  1. activeSlideIndex

    (Required)

    Type: Number

    The (child) index of the <Slide /> component you want to show. Zero-based.

  2. children

    (Required)

    Type: ReactNode | Function

  3. maxTransitionDurationInMs

    (Optional)

    Type: Number

    The maximum duration in ms of transitioning between two arbitrary slides. Normally, the transition between two adjacent slides is 250ms, this is multiplied by the number of slides to transition, and maxed to whatever you specify here. Defaults to 1000.

    Default value

  4. paddingSize

    (Optional)

    Default value